-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
42 lines (31 loc) · 1.17 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
# Makefile for gcc.
# You'll probably have to adjust it to fit your own needs, depending on where you installed Flexium
FLEXIUM_PATH := ../Flexium/
FLEXIMGUI_INCLUDE := ./include/
LIB_NAME := libfleximgui
LIB_FILENAME := lib$(LIB_NAME).a
CPP_FILES := $(wildcard src/*.cpp)
OBJ_FILES := $(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
DEP_FILES := $(OBJ_FILES:.o=.d)
CC_FLAGS := -Wall -g -std=c++11 -I $(FLEXIUM_PATH)include -I $(FLEXIMGUI_INCLUDE) -O2
CPP_TEST_FILES := $(wildcard tests/*.cpp)
EXE_LINK_FLAGS := -L $(FLEXIUM_PATH)lib -L ./lib -lflexium -l$(LIB_NAME) -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
-include obj/$(wildcard *.d)
all: lib/lib$(LIB_NAME).a
lib/$(LIB_FILENAME): $(OBJ_FILES)
rm $@ -f
ar -c -rs $@ $^
obj/%.o: src/%.cpp
g++ -MMD -c -o $@ $< $(CC_FLAGS)
clean:
rm lib/$(LIB_FILENAME) -f
rm $(OBJ_FILES) -f
rm $(DEP_FILES) -f
rm demo/demo.exe -f
# rm $(wildcard tests/*.exe) -f
demo: lib/$(LIB_FILENAME) demo/Demo.cpp
g++ demo/Demo.cpp $(CC_FLAGS) -c -o demo/Demo.o
g++ -o demo/demo.exe demo/Demo.o $(EXE_LINK_FLAGS)
# tests: $(CPP_TEST_FILES) $(CPP_TEST_FILES:.cpp=.exe)
# tests/%.exe: tests/%.cpp
# g++ -o $@ $< $(CC_FLAGS) $(EXE_LINK_FLAGS)