1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| #La liste des modules à compiler
MODULES = gui io menu plugin gest_projet err
SRC = $(foreach dir, $(MODULES), $(wildcard $(dir)/src/*.c))
#Les outils
export CC=gcc
LD=gcc
#Les flags d'erreurs
export ERROR_CFLAGS = -Wall -ansi
#On indique les librariries a passer lors de l'edition des liens
LIBS= -ldl
#Les flags de link
GLIB_LDFLAGS = $$(pkg-config --libs glib-2.0)
PANGO_LDFLAGS = $$(pkg-config --libs pango)
GTK_LDFLAGS = $$(pkg-config --libs gtk+-2.0)
GTKSOURCEVIEW_LDFLAGS = $$(pkg-config --libs gtksourceview-1.0)
LDFLAGS=$(ERROR_FLAGS) $(GLIB_LDFLAGS) $(PANGO_LDFLAGS) $(GTK_LDFLAGS) $(GTKSOURCEVIEW_LDFLAGS) $(LIBS)
#Enfin, quelques règles de compilation ...
all: bin/cworkshop
bin/cworkshop: $(SRC)
for dir in $(MODULES); do\
cd $$dir && $(MAKE);\
cd ..;\
done
for dir in $(MODULES); do\
cp $$dir/bin/*.o bin;\
done
$(LD) -o $@ $(LDFLAGS) bin/*.o
#... et de nettoyage
clean:
for dir in $(MODULES); do\
cd $$dir && $(MAKE) clean;\
cd ..;\
done
rm -f bin/*.o
rm -f bin/cworkshop |
Partager