make: 1571 fixup: dont create existing directories
This fixes an error which was introduced by commit 346313bf07304c5636739d028c7b70acb4b507f9 The timestamp of directories is updated when a file inside a directory is changed. Therefore, make decides a target needs to be rebuilt, whenever that target depends on its parent directory, because the directory is always newer than the file inside. http://www.gnu.org/savannah-checkouts/gnu/make/manual/html_node/Prerequisite-Types.html Occasionally, however, you have a situation where you want to impose a specific ordering on the rules to be invoked without forcing the target to be updated if one of those rules is executed. In that case, you want to define order-only prerequisites. Order-only prerequisites can be specified by placing a pipe symbol (|) in the prerequisites list: any prerequisites to the left of the pipe symbol are normal; any prerequisites to the right are order-only: targets : normal-prerequisites | order-only-prerequisites
This commit is contained in:
parent
f539f30691
commit
182b603a01
@ -46,23 +46,26 @@ DEP := $(OBJC:.o=.d) $(OBJCXX:.o=.d) $(ASSMOBJ:.o=.d)
|
|||||||
$(BINDIR)$(MODULE)/:
|
$(BINDIR)$(MODULE)/:
|
||||||
$(AD)mkdir -p $@
|
$(AD)mkdir -p $@
|
||||||
|
|
||||||
$(BINDIR)$(MODULE).a: $(OBJ) ${DIRS:%=ALL--%} $(BINDIR)$(MODULE)/
|
$(BINDIR)$(MODULE).a $(OBJ): | $(BINDIR)$(MODULE)/
|
||||||
|
|
||||||
|
$(BINDIR)$(MODULE).a: $(OBJ) | ${DIRS:%=ALL--%}
|
||||||
$(AD)$(AR) -rcs $@ $(OBJ)
|
$(AD)$(AR) -rcs $@ $(OBJ)
|
||||||
|
|
||||||
|
|
||||||
CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS)
|
CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS)
|
||||||
|
|
||||||
# compile and generate dependency info
|
# compile and generate dependency info
|
||||||
|
|
||||||
$(OBJC): $(BINDIR)$(MODULE)/%.o: %.c $(BINDIR)$(MODULE)/
|
$(OBJC): $(BINDIR)$(MODULE)/%.o: %.c
|
||||||
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
||||||
|
|
||||||
$(OBJCXX): $(BINDIR)$(MODULE)/%.o: %.cpp $(BINDIR)$(MODULE)/
|
$(OBJCXX): $(BINDIR)$(MODULE)/%.o: %.cpp
|
||||||
$(AD)$(CXX) $(CXXFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
$(AD)$(CXX) $(CXXFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
||||||
|
|
||||||
$(ASMOBJ): $(BINDIR)$(MODULE)/%.o: %.s $(BINDIR)$(MODULE)/
|
$(ASMOBJ): $(BINDIR)$(MODULE)/%.o: %.s
|
||||||
$(AD)$(AS) $(ASFLAGS) -o $@ $(abspath $<)
|
$(AD)$(AS) $(ASFLAGS) -o $@ $(abspath $<)
|
||||||
|
|
||||||
$(ASSMOBJ): $(BINDIR)$(MODULE)/%.o: %.S $(BINDIR)$(MODULE)/
|
$(ASSMOBJ): $(BINDIR)$(MODULE)/%.o: %.S
|
||||||
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)
|
||||||
|
|
||||||
# pull in dependency info for *existing* .o files
|
# pull in dependency info for *existing* .o files
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user