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 CFLAGS
+= -Wall
-DVERSION
=\"$(RELEASE
)\"
34 ifeq ($(TARGET
),cocoa
)
35 LIBS
+= SDLmain.m
-framework SDL
-framework Cocoa
-framework SDL_image
-framework SDL_mixer
36 CFLAGS
+= -I
/Library
/Frameworks
/SDL.framework
/Headers
-I
/Library
/Frameworks
/SDL_image.framework
/Headers
-I
/Library
/Frameworks
/SDL_mixer.framework
/Headers
-DMACOSX
38 LIBS
+= $$(sdl-config
--libs
) -lSDL_mixer
-lSDL_image
39 CFLAGS
+= $$(sdl-config
--cflags)
42 SRC
= tennix.c game.c graphics.c input.c sound.c
43 OBJ
= tennix.o game.o graphics.o input.o sound.o
48 DATAFILES
= README README.
*
49 ifeq ($(TARGET
),cocoa
)
50 DATAFILES
+= data
/Tennix.icns
54 $(CC
) $(CFLAGS
) -o tennix
$(OBJ
) $(LIBS
)
55 test -f tennix.exe
&& upx tennix.exe || true
57 tennix.o
: tennix.c tennix.h game.h graphics.h input.h sound.h
58 graphics.o
: graphics.c graphics.h tennix.h input.h data
/graphics_data.c
59 game.o
: game.c game.h graphics.h tennix.h sound.h
60 sound.o
: sound.c sound.h tennix.h data
/sounds_data.c
63 make
-C data graphics_data.c
66 make
-C data sounds_data.c
69 mkdir
-p
$(OSXAPP
)/Contents
/{MacOS
,/Resources
}
70 cp
-rpv tennix
$(OSXAPP
)/Contents
/MacOS
/Tennix
71 cp
-rpv
$(DATAFILES
) $(OSXAPP
)/Contents
/Resources
/
72 cp
-rpv osxapp.plist
$(OSXAPP
)/Contents
/Info.plist
73 echo
'APPL????' >$(OSXAPP
)/Contents
/PkgInfo
74 zip
-r tennix-
$(RELEASE
)-macosx.zip
$(OSXAPP
)
77 zip tennix-
$(RELEASE
)-win32.zip tennix.exe
$(WIN32LIBS
) $(DATAFILES
)
80 tar czvf tennix-
$(RELEASE
)-bin.
tar.gz tennix
$(DATAFILES
)
83 rm -f
*.o tennix
{,.exe
}
88 rm -f tennix-
$(RELEASE
).zip tennix-
$(RELEASE
)-bin.
tar.gz
90 .PHONY
: distclean clean release-bin release-win32 release-osx