# variable standard pour la compilation CC=gcc # compilateur CFLAGS=-Wall -g -std=c99 # options de compilation LDFLAGS= # options de link LDLIBS=-lm # bibliothèques CPPFLAGS= # options de preprocessing # cible principale (par défaut) all: toto # règle spécifique pour générer l'exécutable toto: toto.o tutu.o tata.o $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) # règle générique de compilation des fichiers C (implicite) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ .PHONY: clean clean: rm -f *.o *~ toto