JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Removed all shields and laser code.
[vor.git] / Makefile
1 #   Rock Dodger! Avoid the rocks as long as you can!
2 #   Copyright (C) 2001  Paul Holt <pad@pcholt.com>
3
4 #   This program is free software; you can redistribute it and/or modify
5 #   it under the terms of the GNU General Public License as published by
6 #   the Free Software Foundation; either version 2 of the License, or
7 #   (at your option) any later version.
8
9 #   This program is distributed in the hope that it will be useful,
10 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #   GNU General Public License for more details.
13
14 #   You should have received a copy of the GNU General Public License
15 #   along with this program; if not, write to the Free Software
16 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18 ldflags := $(shell sdl-config --libs) -lSDL_image -lSDL_mixer
19 cflags := -g $(shell sdl-config --cflags)
20
21 INSTALL = install
22 INSTALL_PROGRAM = $(INSTALL) -o games -g games
23 INSTALL_DATA = $(INSTALL) -m 644
24
25 DATA_PREFIX = /usr/share/vor
26 PROGRAM_PREFIX = /usr/games/bin
27
28 all: vor
29
30 %.o: %.c
31         $(CC) $(cflags) -c -o $@ $^
32
33 vor: SFont.o sound.o main.o
34         $(CC) $(ldflags) -o $@ $^ $(LIBRARIES)
35
36 clean:
37         rm -f *.o vor
38
39 install:        all
40         if [ ! -d $(DATA_PREFIX) ]; then mkdir $(DATA_PREFIX); fi
41         if [ ! -d $(DATA_PREFIX)/banners ]; then mkdir $(DATA_PREFIX)/banners; fi
42         if [ ! -d $(DATA_PREFIX)/fonts ]; then mkdir $(DATA_PREFIX)/fonts; fi
43         if [ ! -d $(DATA_PREFIX)/icons ]; then mkdir $(DATA_PREFIX)/icons; fi
44         if [ ! -d $(DATA_PREFIX)/indicators ]; then mkdir $(DATA_PREFIX)/indicators; fi
45         if [ ! -d $(DATA_PREFIX)/music ]; then mkdir $(DATA_PREFIX)/music; fi
46         if [ ! -d $(DATA_PREFIX)/sounds ]; then mkdir $(DATA_PREFIX)/sounds; fi
47         if [ ! -d $(DATA_PREFIX)/sprites ]; then mkdir $(DATA_PREFIX)/sprites; fi
48
49         $(INSTALL_PROGRAM) ./vor $(PROGRAM_PREFIX)
50         $(INSTALL_DATA) ./data/banners/* $(DATA_PREFIX)/banners/
51         $(INSTALL_DATA) ./data/fonts/* $(DATA_PREFIX)/fonts/
52         $(INSTALL_DATA) ./data/icons/* $(DATA_PREFIX)/icons/
53         $(INSTALL_DATA) ./data/indicators/* $(DATA_PREFIX)/indicators/
54         $(INSTALL_DATA) ./data/music/* $(DATA_PREFIX)/music/
55         $(INSTALL_DATA) ./data/sounds/* $(DATA_PREFIX)/sounds/
56         $(INSTALL_DATA) ./data/sprites/* $(DATA_PREFIX)/sprites/
57         touch $(DATA_PREFIX)/.highscore
58         chmod a+rw $(DATA_PREFIX)/.highscore
59
60 uninstall:
61         rm -f $(PROGRAM_PREFIX)/vor
62         rm -f $(DATA_PREFIX)/banners/*
63         rm -f $(DATA_PREFIX)/fonts/*
64         rm -f $(DATA_PREFIX)/icons/*
65         rm -f $(DATA_PREFIX)/indicators/*
66         rm -f $(DATA_PREFIX)/music/*
67         rm -f $(DATA_PREFIX)/sounds/*
68         rm -f $(DATA_PREFIX)/sprites/*
69         rm -f $(DATA_PREFIX)/.highscore
70
71         if [ -d $(DATA_PREFIX)/banners ]; then rmdir $(DATA_PREFIX)/banners; fi
72         if [ -d $(DATA_PREFIX)/fonts ]; then rmdir $(DATA_PREFIX)/fonts; fi
73         if [ -d $(DATA_PREFIX)/icons ]; then rmdir $(DATA_PREFIX)/icons; fi
74         if [ -d $(DATA_PREFIX)/indicators ]; then rmdir $(DATA_PREFIX)/indicators; fi
75         if [ -d $(DATA_PREFIX)/music ]; then rmdir $(DATA_PREFIX)/music; fi
76         if [ -d $(DATA_PREFIX)/sounds ]; then rmdir $(DATA_PREFIX)/sounds; fi
77         if [ -d $(DATA_PREFIX)/sprites ]; then rmdir $(DATA_PREFIX)/sprites; fi
78         if [ -d $(DATA_PREFIX) ]; then rmdir $(DATA_PREFIX); fi