use pngs instead of bmps
[tennix.git] / makefile
blob2bdf2a225d042395303fa6d0e3b09f5965ef44be
3 # Tennix! SDL Port
4 # Copyright (C) 2003, 2007 Thomas Perl <thp@perli.net>
5 #
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,
19 # MA 02110-1301, USA.
22 CC = gcc
23 RELEASE = svn
25 TARGET ?= default
27 LIBS =
28 CFLAGS = -Wall
30 ifeq ($(TARGET),cocoa)
31 LIBS += SDLmain.m -framework SDL -framework Cocoa -framework SDL_image -framework SDL_mixer
32 CFLAGS += -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL_image.framework/Headers -I/Library/Frameworks/SDL_mixer.framework/Headers -DMACOSX
33 else
34 LIBS += $$(sdl-config --libs) -lSDL_mixer -lSDL_image
35 CFLAGS += $$(sdl-config --cflags)
36 endif
38 SRC = tennix.c game.c graphics.c input.c sound.c
39 OBJ = tennix.o game.o graphics.o input.o sound.o
41 WIN32LIBS = *.dll
42 OSXAPP = Tennix.app
44 DATAFILES = data/*.bmp data/*.png data/*.wav
45 ifeq ($(TARGET),cocoa)
46 DATAFILES += data/Tennix.icns
47 endif
49 tennix: $(OBJ)
50 $(CC) $(CFLAGS) -o tennix $(OBJ) $(LIBS)
51 test -f tennix.exe && upx tennix.exe || true
53 tennix.o: tennix.c tennix.h game.h graphics.h input.h sound.h
54 graphics.o: graphics.c graphics.h tennix.h input.h
55 game.o: game.c game.h graphics.h tennix.h sound.h
56 sound.o: sound.c sound.h tennix.h
58 release-osx: tennix
59 mkdir -p $(OSXAPP)/Contents/{MacOS,/Resources}
60 cp -rpv tennix $(OSXAPP)/Contents/MacOS/Tennix
61 cp -rpv $(DATAFILES) $(OSXAPP)/Contents/Resources/
62 cp -rpv osxapp.plist $(OSXAPP)/Contents/Info.plist
63 echo 'APPL????' >$(OSXAPP)/Contents/PkgInfo
64 zip -r tennix-$(RELEASE).zip $(OSXAPP)
66 release-win32: tennix
67 zip tennix-$(RELEASE).zip tennix.exe $(WIN32LIBS) $(DATAFILES)
69 release-bin: tennix
70 tar czvf tennix-$(RELEASE)-bin.tar.gz tennix $(DATAFILES)
72 clean:
73 rm -f *.o tennix{,.exe}
74 rm -rf $(OSXAPP)
76 distclean: clean
77 rm -f tennix-$(RELEASE).zip tennix-$(RELEASE)-bin.tar.gz
79 .PHONY: distclean clean release-bin release-win32 release-osx