All pastes #979350 Raw Edit

Something

public text v1 · immutable
·published 2008-04-10 08:50 UTC
rendered paste body
#Compilateur
CC=gcc
#Flags de compilation
CFLAGS= -Wall -g
#Flags pour le linkage
LDFLAGS=

#Nom de l'executable
EXEC=fonction

#SRC contient la liste des fichiers sources
#OBJ pour la liste des fichiers objets

SRC=$(wildcard *.c)
#SRC=$(EXEC).c main.c
OBJ=$(SRC:.c=.o)


all: $(EXEC) clean

$(EXEC): $(OBJ)
	@$(CC) -o $@ $^ $(LDFLAGS)
#	@make clean

main.o: $(EXEC).h

%.o: %.c
	@$(CC) -o $@ -c $< $(CFLAGS)

#permet de pouvoir cleaner si un nom de fichier est 'clean'
.PHONY: clean mrproper



clean:
	@rm -rf *.o

mrproper: clean
	@rm -rf $(EXEC)
	@rm -rf *~