aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 855ae7c7f73f370a638e654926a109cc85d73854 (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
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

all: $(EXECUTABLE)

-include $(DEPENDENCIES)

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

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

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