makefile - Execute a phony target with no dependencies first in a parallel make? -
in parallel make, target: dependency should 1:1 order of execution same make no -j. have phony target has no dependencies want execute prior other targets:
.phony: makedirectories makedirectories: make -p /path-to-directory
this target not require dependency needed executed first in parallel make. solution have found following:
-include makedirectories
which works. way make sure phony target makedirectories
executed first.
another approach make targets depend on directory. e.g.:
.secondexpansion: %.o : %.cc | $$(dir $$@) # <---- order-only dependency on directory % : # must last pattern rule mkdir -p $@
yet approach create directories using $(shell ...)
function:
objdir := release $(shell mkdir -p ${objdir})
Comments
Post a Comment