4 # Copyright (C) 2003, 2007 Thomas Perl <thp@perli.net>
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,
28 BINARY_INSTALL_DIR ?
= $(PREFIX
)/bin
31 CFLAGS
+= -Wall
-DVERSION
=\"$(RELEASE
)\" -O2
34 CFLAGS
+= -DDELUXE_EDITION
45 ifeq ($(TARGET
),cocoa
)
46 LIBS
+= SDLmain.m
-framework SDL
-framework Cocoa
-framework SDL_image
-framework SDL_mixer
47 CFLAGS
+= -I
/Library
/Frameworks
/SDL.framework
/Headers
-I
/Library
/Frameworks
/SDL_image.framework
/Headers
-I
/Library
/Frameworks
/SDL_mixer.framework
/Headers
-DMACOSX
49 LIBS
+= $$(sdl-config
--libs
) -lSDL_mixer
-lSDL_image
50 CFLAGS
+= $$(sdl-config
--cflags)
53 SRC
= tennix.c game.c graphics.c input.c sound.c
54 OBJ
= tennix.o game.o graphics.o input.o sound.o
55 ifeq ($(MSYSTEM
),MINGW32
)
62 DATAFILES
= README README.
*
63 ifeq ($(TARGET
),cocoa
)
64 DATAFILES
+= data
/Tennix.icns
68 $(CC
) $(CFLAGS
) -o tennix
$(OBJ
) $(LIBS
)
69 test -f tennix.exe
&& upx tennix.exe || true
75 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
76 install -s tennix
$(DESTDIR
)/$(BINARY_INSTALL_DIR
)/tennix
77 install tennix
.6 $(DESTDIR
)/$(PREFIX
)/share
/man
/man6
/tennix
.6
78 install -m644 data
/icon.png
$(DESTDIR
)/$(PREFIX
)/share
/pixmaps
/tennix.png
79 install -m644 data
/icon.svg
$(DESTDIR
)/$(PREFIX
)/share
/icons
/hicolor
/scalable
/apps
/tennix.svg
80 install -m644 tennix.desktop
$(DESTDIR
)/$(PREFIX
)/share
/applications
/
82 tennix.o
: tennix.c tennix.h game.h graphics.h input.h sound.h
83 graphics.o
: graphics.c graphics.h tennix.h data
/graphics_data.c
84 game.o
: game.c game.h graphics.h tennix.h sound.h input.h
85 sound.o
: sound.c sound.h tennix.h data
/sounds_data.c
87 data
/graphics_data.c
: data
/*.png
88 make
-C data graphics_data.c
90 data
/sounds_data.c
: data
/*.ogg
91 make
-C data sounds_data.c
93 # Mac OS X-specific targets
94 release-osx
: tennix ChangeLog
95 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
96 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
97 cp
-rpv
$(DATAFILES
) ChangeLog
$(OSXAPP
)/Contents
/Resources
/
98 sed
-e
's/TENNIX_VERSION/$(RELEASE)/' osxapp.plist
>$(OSXAPP
)/Contents
/Info.plist
99 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
100 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
101 # End Mac OS X-specific targets
103 # Windows-specific targets
104 release-win32
: tennix ChangeLog
105 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
) ChangeLog
107 tennix-installer.iss
: tennix-installer.iss.in
108 sed tennix-installer.iss.in
-e
's/{version}/$(RELEASE)/g' >tennix-installer.iss
110 release-win32-setup
: tennix ChangeLog tennix-installer.iss
111 iscc tennix-installer.iss
113 tennixres.o
: tennix.res
114 windres tennix.res tennixres.o
115 # End Windows-specific targets
117 release-bin
: tennix ChangeLog
118 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
) ChangeLog
120 release
: distclean ChangeLog
121 mkdir
-p .release-tmp
/tennix-
$(RELEASE
)/
122 cp
-rv
* .release-tmp
/tennix-
$(RELEASE
)/
123 rm -rf .release-tmp
/tennix-
$(RELEASE
)/.git
124 tar czvf tennix-
$(RELEASE
).
tar.gz
-C .release-tmp tennix-
$(RELEASE
)
128 rm -f
*.o tennix tennix.exe
129 rm -rf
$(OSXAPP
) tennix-
*-macosx.zip
130 rm -f tennixres.o tennix-installer.iss tennix-
*-win32-setup.exe
134 rm -rf tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz ChangeLog .release-tmp tennix-
$(RELEASE
).
tar.gz
136 .PHONY
: distclean clean release-bin release-win32 release-win32-setup release-osx
install