-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 915 Bytes
/
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
csources := $(wildcard src/*.c)
cppsources := $(wildcard src/*.cpp)
cobjects := $(csources:src/%.c=cobj/%.o)
cppobjects := $(cppsources:src/%.cpp=obj/%.o)
cdeps := $(cobjects:.o=.d)
cppdeps := $(cppobjects:.o=.d)
CC := x86_64-w64-mingw32-gcc
CXX := x86_64-w64-mingw32-g++
CFLAGS := -m64 -fopenmp -ggdb
CPPFLAGS := -m64 -MMD -MP -fopenmp -ggdb
LDLIBS := -Iinclude -Llib -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf -lSDL2_image \
-lcomdlg32 -lnfd -lole32 -loleaut32 -luuid -lhpdf -lpng -lz -lKiWi -Wno-narrowing
bin/hanjiestudio.exe: $(cppobjects) $(cobjects)
$(CXX) $(CPPFLAGS) $^ $(LDLIBS) -o $@
obj/%.o: src/%.cpp
$(CXX) $(CPPFLAGS) -c -O3 $(OUTPUT_OPTION) $<
cobj/%.o: src/%.c
$(CC) $(CFLAGS) -c -O3 $(OUTPUT_OPTION) $<
bin/res/%: res/%
cp $< $@
clean:
-del $(subst /,\,$(cppobjects) $(cobjects) $(deps)) bin/hanjiestudio.exe
debug: gdb bin/hanjiestudio.exe
run:
bin/hanjiestudio.exe
-include $(deps)