Tennix 0.3.3: Dynamic Text Engine
[tennix.git] / makefile
blob94cc6582d54c5433f4aa46949be918c18c874a1a
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 = 0.3.3
25 TARGET ?= default
27 LIBS =
28 CFLAGS += -Wall -DVERSION=\"$(RELEASE)\"
30 ifeq ($(DEBUG),1)
31 CFLAGS += -DDEBUG
32 endif
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
37 else
38 LIBS += $$(sdl-config --libs) -lSDL_mixer -lSDL_image
39 CFLAGS += $$(sdl-config --cflags)
40 endif
42 SRC = tennix.c game.c graphics.c input.c sound.c
43 OBJ = tennix.o game.o graphics.o input.o sound.o
45 WIN32LIBS = *.dll
46 OSXAPP = Tennix.app
48 DATAFILES = README README.* data/*.png data/*.wav
49 ifeq ($(TARGET),cocoa)
50 DATAFILES += data/Tennix.icns
51 endif
53 tennix: $(OBJ)
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
59 game.o: game.c game.h graphics.h tennix.h sound.h
60 sound.o: sound.c sound.h tennix.h
62 release-osx: tennix
63 mkdir -p $(OSXAPP)/Contents/{MacOS,/Resources}
64 cp -rpv tennix $(OSXAPP)/Contents/MacOS/Tennix
65 cp -rpv $(DATAFILES) $(OSXAPP)/Contents/Resources/
66 cp -rpv osxapp.plist $(OSXAPP)/Contents/Info.plist
67 echo 'APPL????' >$(OSXAPP)/Contents/PkgInfo
68 zip -r tennix-$(RELEASE).zip $(OSXAPP)
70 release-win32: tennix
71 zip tennix-$(RELEASE)-win32.zip tennix.exe $(WIN32LIBS) $(DATAFILES)
73 release-bin: tennix
74 tar czvf tennix-$(RELEASE)-bin.tar.gz tennix $(DATAFILES)
76 clean:
77 rm -f *.o tennix{,.exe}
78 rm -rf $(OSXAPP)
80 distclean: clean
81 rm -f tennix-$(RELEASE).zip tennix-$(RELEASE)-bin.tar.gz
83 .PHONY: distclean clean release-bin release-win32 release-osx