1 # chemin des librairies
6 PATH_LIB = $(PATH_GCC)/lib/
7 PATH_SRC = $(PATH_GCC)/src/
8 PATH_EXEC = $(PATH_GCC)/exec/
10 # repertoires pour les headers
11 PATH_INCLUDE = $(PATH_GCC)/src/
17 # options de compilation
19 # -g : debug (ex : gdb sas)
20 # -pg : profile memoire et cpu pour chaque fonctions (ex : gprof name | less)
21 # -O3 : optimisation code -O0 (rien) ~ -O3 (maxi)
22 # -fstrict-aliasing : aligne la memoire sur 32 bits
25 OPTION_CC1 = -Wall -O3 -static -g -pg #-fprofile-arcs -ftest-coverage
26 OPTION_CC2 = $(OPTION_CC1) -funroll-all-loops -fstrict-aliasing
28 OPTION_CC = $(OPTION_CC2) -I$(PATH_INCLUDE) -I$(PATH_SRC)
31 # librairies pour la compilation
34 # sources utiles a la compilation des main
35 SRCS = lib_alloc.c lib_images.c lib_math.c \
36 lib_snake_common.c lib_contour.c \
37 lib_snake_cumul.c lib_snake_codage_gl.c \
38 lib_snake_move.c lib_snake_mdl.c snake2D.c
41 OBJS = $(SRCS:%.c=$(PATH_LIB)%.o)
43 # dependances supplementaires
44 DEPS = $(PATH_SRC)/constantes.h $(PATH_SRC)/structures.h $(PATH_GCC)/makefile
47 @echo "cibles : snake2D doc clean"
52 -rm -rf $(PATH_GCC)/docs/
58 $(PATH_LIB)%.o : $(PATH_SRC)%.c $(DEPS)
59 $(CC) $(OPTION_CC) -c $< -o $@
61 # regle pour les mains
63 $(PATH_EXEC)SNAKE2D : $(PATH_SRC)snake2D.c $(OBJS) $(DEPS)
64 $(CXX) $(OBJS) -o $(PATH_EXEC)SNAKE2D
68 snake2D : $(PATH_EXEC)SNAKE2D
70 @echo "***** fait pour snake2D *****"
78 @echo "***** fait pour doc *****"