Tennix 1.3.4
[tennix.git] / makefile
blobd05b39f76a40ce6934c11cef42cb0f03c21edd36
3 # Tennix! SDL Port
4 # Copyright (C) 2003, 2007, 2008, 2009 Thomas Perl <thp@thpinfo.com>
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
22 -include config.mk
24 CONFIGURE_OUTPUT := config.mk config.h dependencies.mk
26 ifeq ($(SILENT),0)
27 SILENTMSG := @true
28 SILENTCMD :=
29 else
30 SILENTMSG := @echo
31 SILENTCMD := @
32 endif
34 # Object files for "tennix"
35 TENNIX_BIN := tennix
36 TENNIX_OBJ += src/tennix.o src/game.o src/graphics.o src/input.o
37 TENNIX_OBJ += src/util.o src/sound.o src/animation.o src/archive.o
38 TENNIX_OBJ += src/network.o src/tennixpy.o
40 # Object files for "tnxar"
41 ARCHIVE_BIN := tnxar
42 ARCHIVE_OBJ += src/archivetool.o src/archive.o
44 # Data files for tennix.tnx
45 TENNIX_TNX := tennix.tnx
46 TENNIX_TNX_DATA += $(wildcard data/*.ogg)
47 TENNIX_TNX_DATA += $(wildcard data/*.ttf)
48 TENNIX_TNX_DATA += $(wildcard data/*.png)
50 ifeq ($(HAVE_VOICE_FILES),1)
51 TENNIX_TNX_DATA += $(wildcard voice/*.ogg)
52 endif
54 ifeq ($(HAVE_PYTHON),1)
55 TENNIX_TNX_DATA += $(wildcard data/*.py)
56 endif
58 TENNIX_TNX_DATA := $(sort $(TENNIX_TNX_DATA))
60 # Installable files
61 TENNIX_PNG := data/tennix.png
62 TENNIX_DESKTOP := data/tennix.desktop
63 TENNIX_MAN := data/tennix.6
65 all: $(TENNIX_BIN) $(ARCHIVE_BIN) $(TENNIX_TNX)
67 %.o: %.cc
68 $(SILENTMSG) " CXX $@"
69 $(SILENTCMD)$(CXX) -c $(CFLAGS) -o $@ $<
71 $(TENNIX_BIN): $(TENNIX_OBJ)
72 $(SILENTMSG) " LD $@"
73 $(SILENTCMD)$(CXX) -o $@ $^ $(LDFLAGS)
75 $(ARCHIVE_BIN): $(ARCHIVE_OBJ)
76 $(SILENTMSG) " LD $@"
77 $(SILENTCMD)$(CXX) -o $@ $^
79 $(TENNIX_TNX): $(ARCHIVE_BIN) $(TENNIX_TNX_DATA)
80 $(SILENTMSG) " TNXAR $@"
81 $(SILENTCMD)./$(ARCHIVE_BIN) -cf $@ $(TENNIX_TNX_DATA)
83 install: $(TENNIX_BIN) $(TENNIX_TNX) $(TENNIX_PNG) $(TENNIX_DESKTOP) $(TENNIX_MAN)
84 $(SILENTMSG) " INSTALL $(TENNIX_BIN)"
85 $(SILENTCMD)$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/
86 $(SILENTCMD)$(INSTALL) -m 755 $(TENNIX_BIN) $(DESTDIR)$(PREFIX)/bin/
87 $(SILENTMSG) " INSTALL $(TENNIX_TNX)"
88 $(SILENTCMD)$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/tennix/
89 $(SILENTCMD)$(INSTALL) -m 644 $(TENNIX_TNX) $(DESTDIR)$(PREFIX)/share/tennix/
90 $(SILENTMSG) " INSTALL $(TENNIX_PNG)"
91 $(SILENTCMD)$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/pixmaps/
92 $(SILENTCMD)$(INSTALL) -m 644 $(TENNIX_PNG) $(DESTDIR)$(PREFIX)/share/pixmaps/
93 $(SILENTMSG) " INSTALL $(TENNIX_DESKTOP)"
94 $(SILENTCMD)$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/applications/
95 $(SILENTCMD)$(INSTALL) -m 644 $(TENNIX_DESKTOP) $(DESTDIR)$(PREFIX)/share/applications/
96 $(SILENTMSG) " INSTALL $(TENNIX_MAN)"
97 $(SILENTCMD)$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/man/man6/
98 $(SILENTCMD)$(INSTALL) -m 644 $(TENNIX_MAN) $(DESTDIR)$(PREFIX)/share/man/man6/
100 clean:
101 $(SILENTMSG) " CLEAN"
102 $(SILENTCMD)$(RM) -f $(TENNIX_BIN) $(TENNIX_OBJ)
103 $(SILENTCMD)$(RM) -f $(ARCHIVE_BIN) $(ARCHIVE_OBJ)
104 $(SILENTCMD)$(RM) -f $(TENNIX_TNX)
106 distclean: clean
107 $(SILENTMSG) " DISTCLEAN"
108 $(SILENTCMD)$(RM) -f $(CONFIGURE_OUTPUT)
110 $(CONFIGURE_OUTPUT): configure
111 $(SILENTMSG) " CONFIGURE"
112 $(SILENTCMD)./$<
114 -include dependencies.mk
116 .PHONY: install clean distclean