2011-08-31 15:03:34 +02:00
|
|
|
#################################
|
|
|
|
# Includes globaux et spécifiques
|
|
|
|
#################################
|
|
|
|
#INCLUDES=-I../include
|
|
|
|
|
|
|
|
####################################
|
|
|
|
# Options de compilation spécifiques
|
|
|
|
####################################
|
|
|
|
#CCOPT= -DPUR_LINUX
|
|
|
|
|
|
|
|
#######################
|
|
|
|
# règles de compilation
|
|
|
|
#######################
|
|
|
|
CFLAGS = -Wall -pedantic -Wshadow -ggdb -O2 -Wimplicit -Wreturn-type -Wuninitialized \
|
|
|
|
-Wparentheses -Wpointer-arith
|
|
|
|
|
|
|
|
LDFLAGS = -lpthread
|
|
|
|
|
|
|
|
SRC=$(wildcard *.c)
|
2011-11-25 17:02:16 +01:00
|
|
|
INCLUDES=$(wildcard *.h)
|
2011-08-31 15:03:34 +02:00
|
|
|
#######################
|
|
|
|
# Tâches
|
|
|
|
#######################
|
|
|
|
APPNAME=testapp
|
|
|
|
|
|
|
|
OBJS = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
all: $(APPNAME)
|
|
|
|
|
|
|
|
$(APPNAME): $(OBJS)
|
|
|
|
$(CC) -o $@ $(OBJS) $(LDFLAGS)
|
|
|
|
|
2011-11-25 17:02:16 +01:00
|
|
|
%.o : %.c $(INCLUDES)
|
|
|
|
$(CC) $(CFLAGS) $(CCOPT) -o $@ -c $<
|
2011-08-31 15:16:24 +02:00
|
|
|
|
2011-08-31 15:03:34 +02:00
|
|
|
clean :
|
|
|
|
-rm -f *.o *.a $(APPNAME)
|
|
|
|
|
2011-08-31 15:16:24 +02:00
|
|
|
.PHONY: all clean $(APPNAME)
|