1 # Makefile for supertux
3 # by Bill Kendrick & Tobias Glaesser
4 # bill@newbreedsoftware.com
6 # http://www.newbreedsoftware.com/
10 # April 11, 2000 - December 26, 2000
13 # User-definable stuff:
16 ifeq ($(USERNAME),root)
21 DATA_PREFIX=$(PWD)/data/
23 DATA_PREFIX=$(PREFIX)/share/games/supertux/data/
34 CFLAGS=-Wall -O2 $(SDL_CFLAGS) -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
35 -D$(NOSOUNDFLAG) -D$(TARGET_DEF) -DJOY_$(JOY)
43 SDL_LIB=$(SDL_LDFLAGS) $(SDL_MIXER) $(SDL_IMAGE)
44 SDL_CFLAGS := $(shell sdl-config --cflags)
45 SDL_LDFLAGS := $(shell sdl-config --libs)
46 installbin = install -g $(USERNAME) -o $(USERNAME) -m 755
47 installdat = install -g $(USERNAME) -o $(USERNAME) -m 644
50 OBJECTS=obj/supertux.o obj/setup.o obj/intro.o obj/title.o obj/gameloop.o \
51 obj/screen.o obj/sound.o obj/high_scores.o
58 mkdir -p $(PREFIX)/games/$(TARGET)
59 mkdir -p $(PREFIX)/share/games/$(TARGET)
60 mkdir -p $(PREFIX)/bin/
61 cp -r data $(PREFIX)/share/games/$(TARGET)/
62 chmod -R 0755 $(PREFIX)/share/games/$(TARGET)/data/
63 -$(installbin) $(TARGET) $(PREFIX)/games/$(TARGET)/$(TARGET)
64 ln -sf $(PREFIX)/games/$(TARGET)/$(TARGET) $(PREFIX)/bin/$(TARGET)
67 rm -r $(PREFIX)/games/$(TARGET)
68 rm -r $(PREFIX)/share/games/$(TARGET)
69 rm $(PREFIX)/bin/$(TARGET)
72 make supertux SDL_MIXER= NOSOUNDFLAG=NOSOUND
75 make TARGET_DEF=WIN32 TARGET=supertux.exe \
77 cp /usr/local/cross-tools/i386-mingw32/lib/SDL*.dll .
81 -rm -f supertux supertux.exe
89 $(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(SDL_LIB)
93 obj/supertux.o: src/supertux.c src/defines.h src/globals.h \
94 src/setup.h src/intro.h src/title.h src/gameloop.h \
95 src/screen.h src/sound.h
96 $(CC) $(CFLAGS) src/supertux.c -c -o obj/supertux.o
98 obj/setup.o: src/setup.c src/setup.h \
99 src/defines.h src/globals.h src/screen.h
100 $(CC) $(CFLAGS) src/setup.c -c -o obj/setup.o
102 obj/intro.o: src/intro.c src/intro.h \
103 src/defines.h src/globals.h src/screen.h
104 $(CC) $(CFLAGS) src/intro.c -c -o obj/intro.o
106 obj/title.o: src/title.c src/title.h \
107 src/defines.h src/globals.h src/screen.h
108 $(CC) $(CFLAGS) src/title.c -c -o obj/title.o
110 obj/gameloop.o: src/gameloop.c src/gameloop.h \
111 src/defines.h src/globals.h src/screen.h src/sound.h \
113 $(CC) $(CFLAGS) src/gameloop.c -c -o obj/gameloop.o
115 obj/screen.o: src/screen.c src/defines.h src/globals.h src/screen.h
116 $(CC) $(CFLAGS) src/screen.c -c -o obj/screen.o
118 obj/sound.o: src/sound.c src/defines.h src/globals.h src/sound.h
119 $(CC) $(CFLAGS) src/sound.c -c -o obj/sound.o
121 obj/high_scores.o: src/high_scores.c src/defines.h src/globals.h \
123 $(CC) $(CFLAGS) src/high_scores.c -c -o obj/high_scores.o