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 sound.c
63 OBJ
= tennix.o game.o graphics.o input.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 sound.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
99 archive-lib.o
: archive.c archive.h
102 tennixar
: archive dump
104 archive.o
: archive.c archive.h
105 $(CC
) $(CFLAGS
) -DTENNIXAR_STANDALONE
-c
-o
$@
$<
110 tennix.tnx
: archive
$(TOARCHIVE
)
112 .
/archive
$@
$(TOARCHIVE
)
114 # Mac OS X-specific targets
115 release-osx
: tennix ChangeLog
116 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
117 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
118 cp
-rpv
$(DATAFILES
) ChangeLog
$(OSXAPP
)/Contents
/Resources
/
119 sed
-e
's/TENNIX_VERSION/$(RELEASE)/' osxapp.plist
>$(OSXAPP
)/Contents
/Info.plist
120 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
121 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
122 # End Mac OS X-specific targets
124 # Windows-specific targets
125 release-win32
: tennix ChangeLog
126 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
) ChangeLog
128 tennix-installer.iss
: tennix-installer.iss.in
129 sed tennix-installer.iss.in
-e
's/{version}/$(RELEASE)/g' >tennix-installer.iss
131 release-win32-setup
: tennix ChangeLog tennix-installer.iss
132 iscc tennix-installer.iss
134 tennixres.o
: tennix.res
135 windres tennix.res tennixres.o
136 # End Windows-specific targets
138 release-bin
: tennix ChangeLog
139 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
) ChangeLog
141 release
: distclean ChangeLog
142 mkdir
-p .release-tmp
/tennix-
$(RELEASE
)/
143 cp
-rv
* .release-tmp
/tennix-
$(RELEASE
)/
144 rm -rf .release-tmp
/tennix-
$(RELEASE
)/.git
145 tar czvf tennix-
$(RELEASE
).
tar.gz
-C .release-tmp tennix-
$(RELEASE
)
149 rm -f
*.o tennix tennix.exe archive archive.exe dump dump.exe
150 rm -rf
$(OSXAPP
) tennix-
*-macosx.zip
151 rm -f tennixres.o tennix-installer.iss tennix-
*-win32-setup.exe
155 rm -rf tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz ChangeLog .release-tmp tennix-
$(RELEASE
).
tar.gz
157 .PHONY
: distclean clean release-bin release-win32 release-win32-setup release-osx
install tennixar