4 # Copyright (C) 2003, 2007, 2008, 2009 Thomas Perl <thp@thpinfo.com>
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,
23 ifeq ($(MKCALLGRAPH
),1)
24 CC
= nccgen
-ncgcc
-ncld
-ncfabs
30 UNAME
= $(shell uname
)
33 BINDIR ?
= $(PREFIX
)/bin
34 DATAROOTDIR ?
= $(PREFIX
)/share
35 DATADIR ?
= $(DATAROOTDIR
)/games
38 CFLAGS
+= -std
=c99
-W
-Wall
-ansi
-pedantic
-Wcast-qual
-Wwrite-strings
-DVERSION
=\"$(RELEASE
)\" -O2
-DPREFIX
=\"$(PREFIX
)\" -g
43 ifeq ($(USE_PYTHON
),1)
44 CFLAGS
+= -I
/usr
/include/python
$(PYTHON_VERSION
)/ -DTENNIX_PYTHON
45 LIBS
+= -lpython
$(PYTHON_VERSION
)
48 ifeq ($(NONFREE_LOCATIONS
),1)
49 CFLAGS
+= -DNONFREE_LOCATIONS
52 ifeq ($(UPDRECTANGLE
),1)
53 CFLAGS
+= -DDRAW_UPDATE_RECTANGLE
57 CFLAGS
+= -DDELUXE_EDITION
68 ifeq ($(UNAME
),Darwin
)
69 SDLLIBS
=$$(sdl-config
--prefix)/lib
70 LIBS
+= $$(sdl-config
--static-libs
) $(SDLLIBS
)/libSDL_mixer.a
$(SDLLIBS
)/libSDL_image.a
$(SDLLIBS
)/libSDL_ttf.a
$$(freetype-config
--prefix)/lib
/libfreetype.a
71 CFLAGS
+= $$(sdl-config
--cflags) -lz
73 LIBS
+= $$(sdl-config
--libs
) -lSDL_mixer
-lSDL_image
-lSDL_ttf
74 CFLAGS
+= $$(sdl-config
--cflags)
77 SRC
= tennix.c game.c graphics.c input.c util.c sound.c animation.c
78 OBJ
= tennix.o game.o graphics.o input.o util.o sound.o animation.o archive-lib.o SDL_rotozoom.o
79 ifeq ($(MSYSTEM
),MINGW32
)
82 ifeq ($(USE_PYTHON
),1)
86 TOARCHIVE
=$(wildcard data
/*.ogg data
/*.ttf
wildcard data
/*.png voice
/*.ogg
*.py
)
91 DATAFILES
= README README.
*
92 DATAFILES_OSX
= $(DATAFILES
) data
/Tennix.icns
94 tennix
: $(OBJ
) tennix.tnx
95 $(CC
) $(CFLAGS
) -o tennix
$(OBJ
) $(LIBS
)
96 test -f tennix.exe
&& upx tennix.exe || true
102 install -d
-m
755 $(DESTDIR
)$(BINDIR
)
103 install -d
-m
755 $(DESTDIR
)$(DATAROOTDIR
)/pixmaps
104 install -d
-m
755 $(DESTDIR
)$(DATAROOTDIR
)/applications
105 install -d
-m
755 $(DESTDIR
)$(DATAROOTDIR
)/man
/man6
106 install -d
-m
755 $(DESTDIR
)$(DATAROOTDIR
)/icons
/hicolor
/scalable
/apps
107 install -d
-m
755 $(DESTDIR
)$(DATADIR
)/tennix
108 install -m
755 tennix
$(DESTDIR
)$(BINDIR
)/
109 install -m
644 tennix
.6 $(DESTDIR
)$(DATAROOTDIR
)/man
/man6
/
110 install -m
644 data
/icon.png
$(DESTDIR
)$(DATAROOTDIR
)/pixmaps
/tennix.png
111 install -m
644 data
/icon.svg
$(DESTDIR
)$(DATAROOTDIR
)/icons
/hicolor
/scalable
/apps
/tennix.svg
112 install -m
644 tennix.desktop
$(DESTDIR
)$(DATAROOTDIR
)/applications
/
113 install -m
644 tennix.tnx
$(DESTDIR
)$(DATADIR
)/tennix
/
115 tennix.o
: tennix.c tennix.h game.h graphics.h input.h util.h animation.h sound.h locations.h util.h
116 graphics.o
: graphics.c graphics.h tennix.h archive.h sound.h
117 game.o
: game.c game.h graphics.h tennix.h sound.h input.h util.h
118 sound.o
: sound.c sound.h tennix.h archive.h graphics.h
119 input.o
: input.c input.h tennix.h graphics.h game.h util.h tennixpy.h
120 util.o
: util.c util.h tennix.h
121 animation.o
: animation.c animation.h graphics.h tennix.h credits.h
122 tennixpy.o
: tennix.c tennix.h game.h archive.h
123 SDL_rotozoom.o
: SDL_rotozoom.c SDL_rotozoom.h
125 archive-lib.o
: archive.c archive.h
128 tennixar
: archive dump
130 archive.o
: archive.c archive.h
131 $(CC
) $(CFLAGS
) -DTENNIXAR_STANDALONE
-c
-o
$@
$<
136 tennix.tnx
: archive
$(TOARCHIVE
)
138 .
/archive
$@
$(TOARCHIVE
)
140 # Mac OS X-specific targets
141 release-osx
: tennix tennix.tnx ChangeLog
142 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
143 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
144 cp
-rpv tennix.tnx
$(DATAFILES_OSX
) ChangeLog
$(OSXAPP
)/Contents
/Resources
/
145 sed
-e
's/TENNIX_VERSION/$(RELEASE)/' osxapp.plist
>$(OSXAPP
)/Contents
/Info.plist
146 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
147 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
148 # End Mac OS X-specific targets
150 # Windows-specific targets
151 release-win32
: tennix ChangeLog
152 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
) ChangeLog
154 tennix-installer.iss
: tennix-installer.iss.in
155 sed tennix-installer.iss.in
-e
's/{version}/$(RELEASE)/g' >tennix-installer.iss
157 release-win32-setup
: tennix ChangeLog tennix-installer.iss
158 iscc tennix-installer.iss
160 tennixres.o
: tennix.res
161 windres tennix.res tennixres.o
162 # End Windows-specific targets
164 release-bin
: tennix ChangeLog
165 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
) ChangeLog
167 release
: distclean ChangeLog
168 mkdir
-p .release-tmp
/tennix-
$(RELEASE
)/
169 cp
-rv
* .release-tmp
/tennix-
$(RELEASE
)/
170 rm -rf .release-tmp
/tennix-
$(RELEASE
)/.git
171 tar czvf tennix-
$(RELEASE
).
tar.gz
-C .release-tmp tennix-
$(RELEASE
)
175 rm -f
*.o tennix tennix.exe archive archive.exe dump dump.exe
176 rm -rf
$(OSXAPP
) tennix-
*-macosx.zip
177 rm -f tennixres.o tennix-installer.iss tennix-
*-win32-setup.exe
181 rm -rf tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz ChangeLog .release-tmp tennix-
$(RELEASE
).
tar.gz
183 .PHONY
: distclean clean release-bin release-win32 release-win32-setup release-osx
install tennixar