-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (69 loc) · 2.22 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Makefile
# Auteur : Farès BELHADJ
# Email : amsi@ai.univ-paris8.fr
# Date : 29/01/2017
SHELL = /bin/sh
# définition des commandes utilisées
CC = gcc
ECHO = echo
RM = rm -f
TAR = tar
MKDIR = mkdir
CHMOD = chmod
CP = rsync -R
# déclaration des options du compilateur
CFLAGS = -Wall -O3
CPPFLAGS = -I.
LDFLAGS = -lm -lassimp -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lfftw3 -lglfw
# définition des fichiers et dossiers
PROGNAME = ALYS_squares
VERSION = 1.0
distdir = $(PROGNAME)-$(VERSION)
HEADERS = assimp.h
SOURCES = assimp.c window.c
OBJ = $(SOURCES:.c=.o)
DOXYFILE = documentation/Doxyfile
EXTRAFILES = COPYING $(wildcard shaders/*.?s) $(wildcard audio/*) $(wildcard models/*)
DISTFILES = $(SOURCES) Makefile $(HEADERS) $(DOXYFILE) $(EXTRAFILES)
# Traitement automatique (ne pas modifier)
ifneq (,$(shell ls -d /usr/local/include 2>/dev/null | tail -n 1))
CPPFLAGS += -I/usr/local/include
endif
ifneq (,$(shell ls -d $(HOME)/local/include 2>/dev/null | tail -n 1))
CPPFLAGS += -I$(HOME)/local/include
endif
ifneq (,$(shell ls -d /usr/local/lib 2>/dev/null | tail -n 1))
LDFLAGS += -L/usr/local/lib
endif
ifneq (,$(shell ls -d $(HOME)/local/lib 2>/dev/null | tail -n 1))
LDFLAGS += -L$(HOME)/local/lib
endif
ifeq ($(shell uname),Darwin)
MACOSX_DEPLOYMENT_TARGET = 10.8
CFLAGS += -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
LDFLAGS += -framework OpenGL -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
else
LDFLAGS += -lGL
endif
CPPFLAGS += $(shell sdl2-config --cflags)
LDFLAGS += -lGL4Dummies $(shell sdl2-config --libs)
all: $(PROGNAME)
$(PROGNAME): $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME)
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
dist: distdir
$(CHMOD) -R a+r $(distdir)
$(TAR) zcvf $(distdir).tgz $(distdir)
$(RM) -r $(distdir)
distdir: $(DISTFILES)
$(RM) -r $(distdir)
$(MKDIR) $(distdir)
$(CHMOD) 777 $(distdir)
$(CP) $(DISTFILES) $(distdir)
doc: $(DOXYFILE)
cat $< | sed -e "s/PROJECT_NAME *=.*/PROJECT_NAME = $(PROGNAME)/" | sed -e "s/PROJECT_NUMBER *=.*/PROJECT_NUMBER = $(VERSION)/" >> $<.new
mv -f $<.new $<
cd documentation && doxygen && cd ..
clean:
@$(RM) -r $(PROGNAME) $(OBJ) *~ $(distdir).tgz gmon.out core.* documentation/*~ shaders/*~ GL4D/*~ documentation/html dna.txt assimp_log.txt