1 # Makefile for supertux
4 # bill@newbreedsoftware.com
5 # http://www.newbreedsoftware.com/
9 # April 11, 2000 - December 10, 2003
12 # User-definable stuff:
15 DATA_PREFIX=$(PREFIX)supertux/
25 CFLAGS=-Wall -O2 $(SDL_CFLAGS) -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
26 -D$(NOSOUNDFLAG) -D$(TARGET_DEF) -DJOY_$(JOY)
34 SDL_LIB=$(SDL_LDFLAGS) $(SDL_MIXER) $(SDL_IMAGE)
35 SDL_CFLAGS := $(shell sdl-config --cflags)
36 SDL_LDFLAGS := $(shell sdl-config --libs)
37 installbin = install -g root -o root -m 755
38 installdat = install -g root -o root -m 644
41 OBJECTS=obj/supertux.o obj/setup.o obj/intro.o obj/title.o obj/gameloop.o \
42 obj/screen.o obj/sound.o obj/high_scores.o
49 -mkdir -p $(DATA_PREFIX)
50 cp -R data/* $(DATA_PREFIX)
51 chown -R root.root $(DATA_PREFIX)
52 chmod -R a+rX $(DATA_PREFIX)
53 cp $(TARGET) $(PREFIX)bin/
54 chown root.root $(PREFIX)bin/$(TARGET)
55 chmod a+rx $(PREFIX)bin/$(TARGET)
59 make supertux SDL_MIXER= NOSOUNDFLAG=NOSOUND
62 make TARGET_DEF=WIN32 TARGET=supertux.exe \
64 cp /usr/local/cross-tools/i386-mingw32/lib/SDL*.dll .
68 -rm supertux supertux.exe
76 $(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(SDL_LIB)
81 obj/supertux.o: src/supertux.c src/defines.h src/globals.h \
82 src/setup.h src/intro.h src/title.h src/gameloop.h \
83 src/screen.h src/sound.h
84 $(CC) $(CFLAGS) src/supertux.c -c -o obj/supertux.o
86 obj/setup.o: src/setup.c src/setup.h \
87 src/defines.h src/globals.h src/screen.h
88 $(CC) $(CFLAGS) src/setup.c -c -o obj/setup.o
90 obj/intro.o: src/intro.c src/intro.h \
91 src/defines.h src/globals.h src/screen.h
92 $(CC) $(CFLAGS) src/intro.c -c -o obj/intro.o
94 obj/title.o: src/title.c src/title.h \
95 src/defines.h src/globals.h src/screen.h
96 $(CC) $(CFLAGS) src/title.c -c -o obj/title.o
98 obj/gameloop.o: src/gameloop.c src/gameloop.h \
99 src/defines.h src/globals.h src/screen.h src/sound.h \
101 $(CC) $(CFLAGS) src/gameloop.c -c -o obj/gameloop.o
103 obj/screen.o: src/screen.c src/defines.h src/globals.h src/screen.h
104 $(CC) $(CFLAGS) src/screen.c -c -o obj/screen.o
106 obj/sound.o: src/sound.c src/defines.h src/globals.h src/sound.h
107 $(CC) $(CFLAGS) src/sound.c -c -o obj/sound.o
109 obj/high_scores.o: src/high_scores.c src/defines.h src/globals.h \
111 $(CC) $(CFLAGS) src/high_scores.c -c -o obj/high_scores.o