forked from frogatto/frogatto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (71 loc) · 2.6 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Main Makefile, intended for use on Linux/X11 and compatible platforms.
#
# It should guess the paths to the game dependencies on its own, except for
# Boost which is assumed to be installed to the default locations. If you have
# installed Boost to a non-standard location, you will need to override CXXFLAGS
# and LDFLAGS with any applicable -I and -L arguments.
#
# The main options are:
#
# CXX C++ compiler comand line.
# CXXFLAGS Additional C++ compiler options.
# OPTIMIZE If set to 'yes' (default), builds with compiler
# optimizations enabled (-O2). You may alternatively use
# CXXFLAGS to set your own optimization options.
# LDFLAGS Additional linker options.
#
CXX ?= ccache g++
OPTIMIZE=yes
ifeq ($(OPTIMIZE),yes)
BASE_CXXFLAGS += -O2
endif
# Initial compiler options, used before CXXFLAGS and CPPFLAGS.
BASE_CXXFLAGS += -g -fno-inline-functions -fthreadsafe-statics -Wnon-virtual-dtor -Werror=return-type
# Compiler include options, used after CXXFLAGS and CPPFLAGS.
INC = $(shell pkg-config --cflags x11 sdl glu glew SDL_image libpng zlib)
# Linker library options.
LIBS = $(shell pkg-config --libs x11 ) -lSDLmain \
$(shell pkg-config --libs sdl glu glew SDL_image libpng zlib) -lSDL_ttf -lSDL_mixer
include Makefile.common
%.o : src/%.cpp
$(CXX) \
$(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -DIMPLEMENT_SAVE_PNG \
-c $<
game: $(objects)
$(CXX) \
$(BASE_CXXFLAGS) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) \
$(objects) -o game \
$(LIBS) -lboost_regex-mt -lboost_system-mt -lpthread -fthreadsafe-statics
server: $(server_objects)
$(CXX) \
$(BASE_CXXFLAGS) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) \
$(server_objects) -o server \
$(LIBS) -lboost_regex-mt -lboost_system-mt -lboost_thread-mt -lboost_iostreams-mt
formula_test: $(formula_test_objects)
$(CXX) \
$(BASE_CXXFLAGS) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -DUNIT_TEST_FORMULA \
src/formula.cpp $(formula_test_objects) -o test \
$(LIBS) -lboost_regex
update-pot:
utils/make-pot.sh > po/frogatto.pot.bak
msguniq -F po/frogatto.pot.bak > po/frogatto.pot
rm po/frogatto.pot.bak
%.po: po/frogatto.pot
msgmerge $@ po/frogatto.pot -o [email protected]
mv [email protected] $@
LINGUAS=ar de el en_GB eo es fr hu_HU id it ja ms_MY nl pl pt_BR ru sk sv tt zh_CN
update-po:
(for lang in ${LINGUAS}; do \
${MAKE} po/$$lang.po ; \
done)
update-mo:
(for lang in ${LINGUAS}; do \
mkdir -p locale/$$lang/LC_MESSAGES ; \
msgfmt po/$$lang.po -o locale/$$lang/LC_MESSAGES/frogatto.mo ; \
done)
clean:
rm -f *.o game
assets:
./game --utility=compile_levels
./game --utility=compile_objects