Ho un makefile che crea e chiama un altro makefile. Dal momento che questo makefile chiama più makefile che fa il lavoro non cambia davvero. Così continua a pensare che il progetto sia costruito e aggiornato.Come si forza un makefile per ricostruire un target
dnetdev11 ~ # make
make: `release' is up to date.
Come faccio a forzare il makefile per ricostruire il target?
clean = $(MAKE) -f ~/xxx/xxx_compile.workspace.mak clean
build = svn up ~/xxx \
$(clean) \
~/cbp2mak/cbp2mak -C ~/xxx ~/xxx/xxx_compile.workspace \
$(MAKE) -f ~/xxx/xxx_compile.workspace.mak $(1) \
release:
$(build)
debug:
$(build DEBUG=1)
clean:
$(clean)
install:
cp ~/xxx/source/xxx_utility/release/xxx_util /usr/local/bin
cp ~/xxx/source/xxx_utility/release/xxxcore.so /usr/local/lib
Nota: i nomi rimossi per proteggere gli innocenti
Edit: Final versione fissa:
clean = $(MAKE) -f xxx_compile.workspace.mak clean;
build = svn up; \
$(clean) \
./cbp2mak/cbp2mak -C . xxx_compile.workspace; \
$(MAKE) -f xxx_compile.workspace.mak $(1); \
.PHONY: release debug clean install
release:
$(call build,)
debug:
$(call build,DEBUG=1)
clean:
$(clean)
install:
cp ./source/xxx_utillity/release/xxx_util /usr/bin
cp ./dlls/Release/xxxcore.so /usr/lib
Questa risposta, sebbene sia "accettata" e altamente "ottimizzata", è davvero off-the-mark. In primo luogo, dice "dichiarare gli obiettivi come falsi", ma poi dice "l'obiettivo fasullo non è in realtà il nome di un file".Bene, se il tuo obiettivo è un file, allora questa è una contraddizione nella risposta. Secondo, dice "l'obiettivo fasullo non dovrebbe essere un prerequisito di un reale" - beh, e se lo fosse? La domanda originale, non ha specificato se è o non lo è. La risposta corretta è, _non_ dichiarare _your_ bersagli per essere fasulli, ma piuttosto dichiarare un bersaglio fasullo aggiuntivo, e quindi, dipendere dai bersagli che vuoi ricostruire, su quello. –