forked from benoitryder/megumi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
42 lines (28 loc) · 779 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
38
39
40
CXX = g++
CPPFLAGS += -g -Wall -Wextra -Werror
# sadly, it does warn about designated initializers
# (despite what is stated in docs)
CPPFLAGS += -Wno-missing-field-initializers
CXXFLAGS += -std=c++11 -O2
LDFLAGS += -lboost_program_options$(BOOST_SUFFIX)
TARGET = megumi
SRCS = $(wildcard $(addsuffix /*.cpp,. model block))
OBJS = $(SRCS:.cpp=.o)
ifeq ($(OS),Windows_NT)
LDFLAGS += -lws2_32
LDFLAGS += -static-libgcc -static-libstdc++
endif
ifneq ($(PREFIX),)
CPPFLAGS += -I$(PREFIX)/include
LDFLAGS += -L$(PREFIX)/lib
endif
.PHONY: default all clean
default: $(TARGET)
all: default
-include $(OBJS:.o=.d)
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -c $< -o $@
clean:
rm -f $(TARGET) $(OBJS) $(OBJS:.o=.d)