40 lines
777 B
Makefile
40 lines
777 B
Makefile
|
#################################
|
||
|
# 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)
|
||
|
|
||
|
#######################
|
||
|
# Tâches
|
||
|
#######################
|
||
|
APPNAME=testapp
|
||
|
|
||
|
OBJS = $(SRC:.c=.o)
|
||
|
|
||
|
all: $(APPNAME)
|
||
|
|
||
|
$(APPNAME): $(OBJS)
|
||
|
$(CC) -o $@ $(OBJS) $(LDFLAGS)
|
||
|
|
||
|
%.o : %.c
|
||
|
$(CC) $(CFLAGS) $(INCLUDES) $(CCOPT) -o $@ -c $<
|
||
|
|
||
|
clean :
|
||
|
-rm -f *.o *.a $(APPNAME)
|
||
|
|
||
|
.PHONY: all clean
|