Makefile
Automatische Variablen
- $@ Name das Ziels
- $^ Name aller Voraussetzungen, getrennt durch Leerzeichen
- $< ist die erste Voraussetzung
Beispiele:
hello: main.o helper.o
$(CC) $(CC_OPTS) $^ -o $@
main.o: main.c $(HEADERS)
$(CC) $(CC_OPTS) -c $
Beispiele:
hello: main.o helper.o
$(CC) $(CC_OPTS) $^ -o $@
main.o: main.c $(HEADERS)
$(CC) $(CC_OPTS) -c $