From 06cd611090f6f13350d9147e2ea7b75f8b2f9470 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 31 Aug 2011 15:03:34 +0200 Subject: [PATCH] Add a makefile example --- models/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 models/Makefile diff --git a/models/Makefile b/models/Makefile new file mode 100644 index 0000000..978715d --- /dev/null +++ b/models/Makefile @@ -0,0 +1,39 @@ +################################# +# 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