Skip to content

Instantly share code, notes, and snippets.

@guervild
Created September 7, 2015 17:13
Show Gist options
  • Save guervild/9da2f55266f0d912b612 to your computer and use it in GitHub Desktop.
Save guervild/9da2f55266f0d912b612 to your computer and use it in GitHub Desktop.
Makefile tout simple pour compiler les TP de systèmes.
.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
@seysn
Copy link

seysn commented Sep 16, 2015

Oui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment