JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
gnu autoconf docs say input should be named configure.ac
[vor.git] / Makefile.in
1 #   Variations on Rockdodger
2 #   Copyright (C) 2004  Joshua Grams <josh@qualdan.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
19 SHELL = /bin/sh
20 VPATH = @srcdir@
21
22 subdirs = @subdirs@
23 top_srcdir = @top_srcdir@
24 srcdir = @srcdir@
25 prefix = @prefix@
26 exec_prefix = @exec_prefix@
27 datarootdir = $(prefix)/share
28 pkgdatadir = $(datarootdir)/vor
29 bindir = $(exec_prefix)/bin
30
31 CC = @CC@
32 CPPFLAGS = @CPPFLAGS@
33 CFLAGS = $(CPPFLAGS) @CFLAGS@
34 LDFLAGS = @LDFLAGS@
35 LIBS = @LIBS@
36 INSTALL = @INSTALL@
37
38
39
40
41
42 paths := -DDATA_PREFIX=\"$(pkgdatadir)\"
43 SDL_CFLAGS := @SDL_CFLAGS@
44 SDL_LIBS := @SDL_LIBS@
45
46 ldflags := $(SDL_LIBS) -lSDL_image -lSDL_mixer $(LDFLAGS)
47 cflags := $(SDL_CFLAGS) $(paths) $(CFLAGS)
48
49 my_objects := args.o dust.o file.o mt.o rocks.o score.o sprite.o sound.o autopilot.o
50 my_objects += main.o
51 libs := font.o
52 objects := $(libs) $(my_objects)
53
54 rocks := 00 01 02 03 04 05 06 07 08 09
55 rocks += 10 11 12 13 14 15 16 17 18 19
56 rocks += 20 21 22 23 24 25 26 27 28 29
57 rocks += 30 31 32 33 34 35 36 37 38 39
58 rocks += 40 41 42 43 44 45 46 47 48 49
59 rocks := $(rocks:%=data/rock%.png)
60 graphics := data/ship.png data/icon.png data/life.png data/font.png $(rocks)
61
62 INSTALL := install
63 INSTALL_PROGRAM := $(INSTALL)
64 INSTALL_DATA := $(INSTALL) -m 644
65
66
67 .PHONY: all clean maintainer-clean install uninstall
68 .PHONY: mkinstalldirs rminstalldirs
69 .PHONY: program program-clean install-program uninstall-program
70 .PHONY: data data-clean install-data uninstall-data
71
72 .INTERMEDIATE: font_guts font_guts.pov
73
74 all: program data
75
76 data: $(graphics)
77
78 program: vor
79
80 %.o: %.c
81         $(CC) $(cflags) -c -o $@ $<
82
83 $(my_objects): vorconfig.h
84
85 font.o: font.h
86
87 args.o: args.h
88
89 dust.o: globals.h dust.h float.h mt.h
90
91 file.o: file.h common.h
92
93 main.o: args.h common.h dust.h file.h float.h globals.h mt.h rocks.h score.h sprite.h sound.h autopilot.h
94
95 mt.o: mt.h
96
97 rocks.o: rocks.h common.h file.h globals.h mt.h sprite.h
98
99 score.o: score.h common.h file.h
100
101 sound.o: sound.h args.h common.h
102
103 sprite.o: sprite.h common.h
104
105 vor: $(objects)
106         $(CC) $^ $(ldflags) -o $@
107
108 include gfx.mk
109
110 tags: *.c *.h
111         exuberant-ctags *.c *.h /usr/include/SDL/*
112
113 clean: program-clean
114         rm -f tags
115
116 maintainer-clean: program-clean data-clean
117
118 program-clean:
119         rm -f *.o vor
120
121 data-clean:
122         rm -f $(graphics) font_guts font_guts.pov
123
124 mkinstalldirs:
125         if [ ! -d $(DESTDIR)$(pkgdatadir) ]; then mkdir -p $(DESTDIR)$(pkgdatadir); fi
126         if [ ! -d $(DESTDIR)$(bindir) ]; then mkdir -p $(DESTDIR)$(bindir); fi
127
128 rminstalldirs: uninstall-data
129         if [ -d $(DESTDIR)$(pkgdatadir) ]; then rmdir $(DESTDIR)$(pkgdatadir); fi
130
131 install: all mkinstalldirs install-program install-data
132
133 install-program: program
134         $(INSTALL_PROGRAM) ./vor $(DESTDIR)$(bindir)/
135
136 install-data: data mkinstalldirs
137         $(INSTALL_DATA) ./data/*.png $(DESTDIR)$(pkgdatadir)/
138         $(INSTALL_DATA) ./data/*.wav $(DESTDIR)$(pkgdatadir)/
139         $(INSTALL_DATA) ./data/*.xm $(DESTDIR)$(pkgdatadir)/
140         @echo
141         @echo "$(pkgdatadir)/icon.png (48x48) or ship.png (32x32) make good icons."
142         @echo
143
144 uninstall: uninstall-program uninstall-data rminstalldirs
145
146 uninstall-program:
147         rm -f $(DESTDIR)$(bindir)/vor
148
149 uninstall-data:
150         rm -f $(DESTDIR)$(pkgdatadir)/*.png
151         rm -f $(DESTDIR)$(pkgdatadir)/*.wav
152         rm -f $(DESTDIR)$(pkgdatadir)/*.xm