aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..855ae7c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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)