rubricanis
Homo ludens
Langsam - wenn auch mühselig - gewöhnen ich mich ja an gmake. Was ich noch nicht hinbekomme ist die Abhängigkeit von header files. Ein Beispiel aus einem Submakefile:
Ich hatte u.A. vermutet das folgendes funktioniert:
Aber das ist nicht der Fall. Wie macht man das also ?
Code:
target := $(bin)/myapp
header := \
$(include)/common.hpp
objects := \
$(build)/main.o
# targets
$(target): $(build) $(objects)
@echo == creating app ===
$(silent)$(cxx) -o $(target) $(flags) $(objects) $(libs)
$(build)/%.o: $(src)/%.cpp
$(silent)$(cxx) -c $(flags) -I$(include) -o $@ $<
$(build):
$(silent) mkdir -p $@
Code:
$(build)/%.o: $(src)/%.cpp $(header)
$(silent)$(cxx) -c $(flags) -I$(include) -o $@ $<