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
41 ifeq ($(TARGET
),cocoa
)
42 LIBS
+= SDLmain.m
-framework SDL
-framework Cocoa
-framework SDL_image
-framework SDL_mixer
43 CFLAGS
+= -I
/Library
/Frameworks
/SDL.framework
/Headers
-I
/Library
/Frameworks
/SDL_image.framework
/Headers
-I
/Library
/Frameworks
/SDL_mixer.framework
/Headers
-DMACOSX
45 LIBS
+= $$(sdl-config
--libs
) -lSDL_mixer
-lSDL_image
46 CFLAGS
+= $$(sdl-config
--cflags)
49 SRC
= tennix.c game.c graphics.c input.c sound.c
50 OBJ
= tennix.o game.o graphics.o input.o sound.o
51 ifeq ($(MSYSTEM
),MINGW32
)
58 DATAFILES
= README README.
*
59 ifeq ($(TARGET
),cocoa
)
60 DATAFILES
+= data
/Tennix.icns
64 $(CC
) $(CFLAGS
) -o tennix
$(OBJ
) $(LIBS
)
65 test -f tennix.exe
&& upx tennix.exe || true
71 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
72 install -s tennix
$(DESTDIR
)/$(BINARY_INSTALL_DIR
)/tennix
73 install tennix
.6 $(DESTDIR
)/$(PREFIX
)/share
/man
/man6
/tennix
.6
74 install -m644 data
/icon.png
$(DESTDIR
)/$(PREFIX
)/share
/pixmaps
/tennix.png
75 install -m644 data
/icon.svg
$(DESTDIR
)/$(PREFIX
)/share
/icons
/hicolor
/scalable
/apps
/tennix.svg
76 install -m644 tennix.desktop
$(DESTDIR
)/$(PREFIX
)/share
/applications
/
78 tennix.o
: tennix.c tennix.h game.h graphics.h input.h sound.h
79 graphics.o
: graphics.c graphics.h tennix.h data
/graphics_data.c
80 game.o
: game.c game.h graphics.h tennix.h sound.h input.h
81 sound.o
: sound.c sound.h tennix.h data
/sounds_data.c
83 data
/graphics_data.c
: data
/*.png
84 make
-C data graphics_data.c
86 data
/sounds_data.c
: data
/*.ogg
87 make
-C data sounds_data.c
89 # Mac OS X-specific targets
90 release-osx
: tennix ChangeLog
91 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
92 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
93 cp
-rpv
$(DATAFILES
) ChangeLog
$(OSXAPP
)/Contents
/Resources
/
94 sed
-e
's/TENNIX_VERSION/$(RELEASE)/' osxapp.plist
>$(OSXAPP
)/Contents
/Info.plist
95 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
96 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
97 # End Mac OS X-specific targets
99 # Windows-specific targets
100 release-win32
: tennix ChangeLog
101 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
) ChangeLog
103 tennix-installer.iss
: tennix-installer.iss.in
104 sed tennix-installer.iss.in
-e
's/{version}/$(RELEASE)/g' >tennix-installer.iss
106 release-win32-setup
: tennix ChangeLog tennix-installer.iss
107 iscc tennix-installer.iss
109 tennixres.o
: tennix.res
110 windres tennix.res tennixres.o
111 # End Windows-specific targets
113 release-bin
: tennix ChangeLog
114 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
) ChangeLog
116 release
: distclean ChangeLog
117 mkdir
-p .release-tmp
/tennix-
$(RELEASE
)/
118 cp
-rv
* .release-tmp
/tennix-
$(RELEASE
)/
119 rm -rf .release-tmp
/tennix-
$(RELEASE
)/.git
120 tar czvf tennix-
$(RELEASE
).
tar.gz
-C .release-tmp tennix-
$(RELEASE
)
124 rm -f
*.o tennix tennix.exe
125 rm -rf
$(OSXAPP
) tennix-
*-macosx.zip
126 rm -f tennixres.o tennix-installer.iss tennix-
*-win32-setup.exe
130 rm -rf tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz ChangeLog .release-tmp tennix-
$(RELEASE
).
tar.gz
132 .PHONY
: distclean clean release-bin release-win32 release-win32-setup release-osx
install