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
33 BINARY_INSTALL_DIR ?
= $(PREFIX
)/bin
36 CFLAGS
+= -std
=c99
-W
-Wall
-ansi
-pedantic
-Wcast-qual
-Wwrite-strings
-DVERSION
=\"$(RELEASE
)\" -O2
-DPREFIX
=\"$(PREFIX
)\"
38 ifeq ($(UPDRECTANGLE
),1)
39 CFLAGS
+= -DDRAW_UPDATE_RECTANGLE
43 CFLAGS
+= -DDELUXE_EDITION
51 CFLAGS
+= -DMAEMO
-mfpu
=vfp
-mfloat-abi
=softfp
-mcpu
=arm1136j-s
54 ifeq ($(TARGET
),cocoa
)
55 LIBS
+= SDLmain.m
-framework SDL
-framework Cocoa
-framework SDL_image
-framework SDL_mixer
56 CFLAGS
+= -I
/Library
/Frameworks
/SDL.framework
/Headers
-I
/Library
/Frameworks
/SDL_image.framework
/Headers
-I
/Library
/Frameworks
/SDL_mixer.framework
/Headers
-DMACOSX
58 LIBS
+= $$(sdl-config
--libs
) -lSDL_mixer
-lSDL_image
59 CFLAGS
+= $$(sdl-config
--cflags)
62 SRC
= tennix.c game.c graphics.c input.c util.c sound.c
63 OBJ
= tennix.o game.o graphics.o input.o util.o sound.o archive-lib.o
64 ifeq ($(MSYSTEM
),MINGW32
)
68 TOARCHIVE
=$(wildcard data
/*.ogg
wildcard data
/*.png voice
/*.ogg
)
73 DATAFILES
= README README.
*
74 ifeq ($(TARGET
),cocoa
)
75 DATAFILES
+= data
/Tennix.icns
78 tennix
: $(OBJ
) tennix.tnx
79 $(CC
) $(CFLAGS
) -o tennix
$(OBJ
) $(LIBS
)
80 test -f tennix.exe
&& upx tennix.exe || true
86 install -d
$(DESTDIR
)/$(BINARY_INSTALL_DIR
) $(DESTDIR
)/$(PREFIX
)/share
/pixmaps
$(DESTDIR
)/$(PREFIX
)/share
/applications
$(DESTDIR
)/$(PREFIX
)/share
/man
/man6
$(DESTDIR
)/$(PREFIX
)/share
/icons
/hicolor
/scalable
/apps
$(DESTDIR
)/$(PREFIX
)/share
/tennix
87 install -s tennix
$(DESTDIR
)/$(BINARY_INSTALL_DIR
)/tennix
88 install tennix
.6 $(DESTDIR
)/$(PREFIX
)/share
/man
/man6
/tennix
.6
89 install -m644 data
/icon.png
$(DESTDIR
)/$(PREFIX
)/share
/pixmaps
/tennix.png
90 install -m644 data
/icon.svg
$(DESTDIR
)/$(PREFIX
)/share
/icons
/hicolor
/scalable
/apps
/tennix.svg
91 install -m644 tennix.desktop
$(DESTDIR
)/$(PREFIX
)/share
/applications
/
92 install -m644 tennix.tnx
$(DESTDIR
)/$(PREFIX
)/share
/tennix
/
94 tennix.o
: tennix.c tennix.h game.h graphics.h input.h util.h sound.h locations.h util.h
95 graphics.o
: graphics.c graphics.h tennix.h archive.h sound.h
96 game.o
: game.c game.h graphics.h tennix.h sound.h input.h
97 sound.o
: sound.c sound.h tennix.h archive.h graphics.h
98 input.o
: input.c input.h
101 archive-lib.o
: archive.c archive.h
104 tennixar
: archive dump
106 archive.o
: archive.c archive.h
107 $(CC
) $(CFLAGS
) -DTENNIXAR_STANDALONE
-c
-o
$@
$<
112 tennix.tnx
: archive
$(TOARCHIVE
)
114 .
/archive
$@
$(TOARCHIVE
)
116 # Mac OS X-specific targets
117 release-osx
: tennix ChangeLog
118 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
119 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
120 cp
-rpv
$(DATAFILES
) ChangeLog
$(OSXAPP
)/Contents
/Resources
/
121 sed
-e
's/TENNIX_VERSION/$(RELEASE)/' osxapp.plist
>$(OSXAPP
)/Contents
/Info.plist
122 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
123 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
124 # End Mac OS X-specific targets
126 # Windows-specific targets
127 release-win32
: tennix ChangeLog
128 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
) ChangeLog
130 tennix-installer.iss
: tennix-installer.iss.in
131 sed tennix-installer.iss.in
-e
's/{version}/$(RELEASE)/g' >tennix-installer.iss
133 release-win32-setup
: tennix ChangeLog tennix-installer.iss
134 iscc tennix-installer.iss
136 tennixres.o
: tennix.res
137 windres tennix.res tennixres.o
138 # End Windows-specific targets
140 release-bin
: tennix ChangeLog
141 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
) ChangeLog
143 release
: distclean ChangeLog
144 mkdir
-p .release-tmp
/tennix-
$(RELEASE
)/
145 cp
-rv
* .release-tmp
/tennix-
$(RELEASE
)/
146 rm -rf .release-tmp
/tennix-
$(RELEASE
)/.git
147 tar czvf tennix-
$(RELEASE
).
tar.gz
-C .release-tmp tennix-
$(RELEASE
)
151 rm -f
*.o tennix tennix.exe archive archive.exe dump dump.exe
152 rm -rf
$(OSXAPP
) tennix-
*-macosx.zip
153 rm -f tennixres.o tennix-installer.iss tennix-
*-win32-setup.exe
157 rm -rf tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz ChangeLog .release-tmp tennix-
$(RELEASE
).
tar.gz
159 .PHONY
: distclean clean release-bin release-win32 release-win32-setup release-osx
install tennixar