CC = gcc CFLAGS = -ansi -pedantic -Wall LDFLAGS = EXEC = mastermind SRC = $(wildcard *.c) OBJ = $(SRC:.c=.o) TGZDIR = MasterMind all: $(EXEC) clean # Suppression des fichiers inutiles clean: @rm -rf *.out # Executables temporaires @rm -rf *.o # Fichiers objets @rm -rf *~ # Fichiers backup @rm -rf cscope.out # Sortie de cscope # Suppression des fichiers inutiles ET de l'exécutable cleaner: clean @rm -rf $(EXEC) # Création de l'archive contenant les sources dist: cleaner @mkdir $(TGZDIR) @cp *.c $(TGZDIR) @cp *.h $(TGZDIR) @cp Makefile $(TGZDIR) @cp Projet.pdf $(TGZDIR) tar -cvzf $(TGZDIR).tar.gz $(TGZDIR) @rm -rvf $(TGZDIR) # Cible particulière .PHONY: clean cleaner dist mastermind: $(OBJ) @$(CC) -o $(@) $^ $(LDFLAGS) main.o: Mastermind.h Reponse.h Sequence.h Tab4.h Tab6.h Mastermind.o: Mastermind.h Reponse.h Sequence.h Tab4.h Tab6.h Reponse.o: Reponse.h Sequence.o: Sequence.h Tab4.o: Tab4.h Tab6.o: Tab6.h %.o: %.c base.h @$(CC) -o $@ -c $< $(CFLAGS)