aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 423c1ac7a93913ec00454a1869365a05e494b542 (plain)
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
OS = $(shell uname -s)

CC 			?= 	cc
CXX			?= 	c++
DESTDIR		?= 	/usr
FLAGS 		+= 	-std=c++11
ifdef DEBUG
FLAGS		+=	-ggdb -O0
else
FLAGS		+=	-O3
endif

LIBS 		= 	glfw3 assimp
CFLAGS		+=	-I. $(FLAGS) -c -MMD `pkg-config --cflags $(LIBS)`
LDFLAGS		+=	$(FLAGS) `pkg-config --libs $(LIBS)`
ifneq ($(OS), Darwin)
LDFLAGS		+=	-lGL
endif

SOURCES		= 	test.cxx
OBJECTS		= 	$(SOURCES:.cxx=.o)
DEPENDENCIES=	$(SOURCES:.cxx=.d)
EXECUTABLE	=	test

.PHONY: all clean pages

all: $(EXECUTABLE)

-include $(DEPENDENCIES)

$(EXECUTABLE): $(OBJECTS)
	$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)

clean:
	rm $(EXECUTABLE) $(OBJECTS) $(DEPENDENCIES)

%.o: %.cxx
	$(CXX) $< -o $@ $(CFLAGS)

pages:
	doxygen Doxyfile
	mv html/* .
	rmdir html