Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- empty:=
- space:= $(empty) $(empty)
- path_escape = $(subst $(space),$(space),$(1))
- TOP=$(call path_escape,$(abspath .))
- TARGET=$(TOP)/foo
- $(info TOP='$(TOP)')
- $(info TARGET='$(TARGET)')
- all: $(TARGET)
- $(TARGET):
- touch '$(notdir $@)'
- .PHONY: $(TARGET)
- $ make
- TOP='/tmp/space-test'
- TARGET='/tmp/space-test/foo'
- touch 'foo'
- TOP='/tmp/space test'
- TARGET='/tmp/space test/foo'
- touch 'space foo'
- s? = $(subst $(empty) ,?,$1)
- ?s = $(subst ?, ,$1)
- notdirx = $(call ?s,$(notdir $(call s?,$1)))
- $(TARGET):
- touch '$(call notdirx,$@)'
Add Comment
Please, Sign In to add comment