-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 1.14 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
42
CXX = g++
RM = rm -f
SRCS = src/cell.cpp src/devices.cpp src/emit.cpp \
src/io_functions.cpp src/load.cpp src/source_line.cpp
CSRCS = src/main.cpp src/board.cpp
VSRCS = src/visual_main.cpp src/surfaces.cpp src/board.cpp
OBJS = $(patsubst src/%.cpp, obj/%.o, $(SRCS))
COBJS = $(patsubst src/%.cpp, obj/%-c.o, $(CSRCS))
VOBJS = $(patsubst src/%.cpp, obj/%-v.o, $(VSRCS))
LIBS := $(shell pkg-config --cflags-only-other --libs gtk+-3.0 freetype2 pangoft2)
INCLUDES := $(shell pkg-config --cflags-only-I --libs gtk+-3.0 freetype2 pangoft2)
CXXFLAGS = -ggdb -Wall -std=c++11 -static-libstdc++
ifeq ($(OS), Windows_NT)
BIN_SUFFIX = .exe
else
BIN_SUFFIX =
endif
all: bin/marbelous$(BIN_SUFFIX) bin/vmarbelous$(BIN_SUFFIX)
bin/marbelous$(BIN_SUFFIX): $(OBJS) $(COBJS)
$(CXX) $(CXXFLAGS) -o $@ $^
bin/vmarbelous$(BIN_SUFFIX): $(OBJS) $(VOBJS)
$(CXX) $(CXXFLAGS) -DVMARBELOUS=1 -o $@ $^ $(LIBS)
obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^ $(INCLUDES)
obj/%-c.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^ $(INCLUDES)
obj/%-v.o: src/%.cpp
$(CXX) $(CXXFLAGS) -DVMARBELOUS=1 -c -o $@ $^ $(INCLUDES)
clean:
$(RM) obj/*.o
$(RM) bin/*$(BIN_SUFFIX)