Created
September 7, 2015 17:13
-
-
Save guervild/9da2f55266f0d912b612 to your computer and use it in GitHub Desktop.
Makefile tout simple pour compiler les TP de systèmes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY:clean | |
#Constante | |
CC= gcc | |
CFLAGS= -W -Wall -Werror | |
SRC= $(wildcard *.c) | |
JOBS= $(SRC:.c =.o) | |
#regles | |
#Fait un make prog automatiquement | |
all : prog | |
#Recherche toutes les dependances | |
makefile.dep: $(SRC) | |
gcc -MM *.c $^ > $@ | |
#Compilation et éditions de liens | |
prog: $(JOBS) | |
gcc -o $@ $^ | |
include makefile.dep | |
#supression | |
clean: | |
rm -f *.o | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oui