git.haldean.org ana / master GNUmakefile
master

Tree @master (Download .tar.gz)

GNUmakefile @masterraw · history · blame

cxx_sources = \
	src/ana.cpp \
	src/font.gen.cpp \
	src/node.cpp \
	src/reallocarray.cpp \
	src/shaders.cpp \
	src/ui.cpp \
	src/viewport.cpp \
	lib/imgui/imgui.cpp \
	lib/imgui/imgui_demo.cpp \
	lib/imgui/imgui_draw.cpp \
	lib/imgui/imgui_widgets.cpp \
	lib/imgui/examples/imgui_impl_opengl3.cpp \
	lib/imgui/examples/imgui_impl_glfw.cpp

objects = $(patsubst %.cpp,%.o,$(cxx_sources))
deps = $(patsubst %.cpp,%.d,$(cxx_sources))

CXXFLAGS += -DIMGUI_IMPL_OPENGL_LOADER_GLEW
CXXFLAGS += -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS
CXXFLAGS += -I lib/imgui
CXXFLAGS += -I lib/imgui/examples
CXXFLAGS += -I lib/glew-2.1.0/include
CXXFLAGS += -I lib/glfw-3.2.1.bin.WIN64/include
CXXFLAGS += -I lib/glm
CXXFLAGS += -MD
CXXFLAGS += -ggdb

LDFLAGS += lib\glew-2.1.0\lib\Release\x64\glew32.lib
LDFLAGS += lib\glfw-3.2.1.bin.WIN64\lib-mingw-w64\libglfw3.a
LDFLAGS += -lopengl32
LDFLAGS += -lgdi32
LDFLAGS += -lglu32
LDFLAGS += -lshell32
LDFLAGS += -ggdb

dist: build/ana.exe build/glew32.dll

build:
	mkdir build

build/glew32.dll: lib/glew-2.1.0/bin/Release/x64/glew32.dll build
	cp $< $@

build/ana.exe: $(objects) build
	$(CXX) $(objects) $(LDFLAGS) -o $@

XD = tool/xd.exe

$(XD): tool/xd-1.4/xd.o
	$(CXX) $< -o $@

src/font.gen.cpp: data/InputMonoNarrow-Regular.ttf $(XD)
	$(XD) -dfont_data $< $@

-include $(patsubst %.o,%.d,$(objects))

clean:
	rm -rf $(objects) $(deps) build tool/xd-1.4/xd.o tool/xd.exe
.PHONY: clean