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/
28 #undefine this for non debugging compilation
37 CFLAGS=-Wall -O2 $(SDL_CFLAGS) -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
38 -D$(NOSOUNDFLAG) -D$(TARGET_DEF) -DJOY_$(JOY) $(DEBUG_FLAG)
46 SDL_LIB=$(SDL_LDFLAGS) $(SDL_MIXER) $(SDL_IMAGE)
47 SDL_CFLAGS := $(shell sdl-config --cflags)
48 SDL_LDFLAGS := $(shell sdl-config --libs)
49 installbin = install -g $(USERNAME) -o $(USERNAME) -m 755
50 installdat = install -g $(USERNAME) -o $(USERNAME) -m 644
53 OBJECTS=obj/supertux.o obj/setup.o obj/intro.o obj/title.o obj/gameloop.o \
54 obj/screen.o obj/sound.o obj/high_scores.o
61 mkdir -p $(PREFIX)/games/$(TARGET)
62 mkdir -p $(PREFIX)/share/games/$(TARGET)
63 mkdir -p $(PREFIX)/bin/
64 cp -r data $(PREFIX)/share/games/$(TARGET)/
65 chmod -R 0755 $(PREFIX)/share/games/$(TARGET)/data/
66 -$(installbin) $(TARGET) $(PREFIX)/games/$(TARGET)/$(TARGET)
67 ln -sf $(PREFIX)/games/$(TARGET)/$(TARGET) $(PREFIX)/bin/$(TARGET)
70 rm -r $(PREFIX)/games/$(TARGET)
71 rm -r $(PREFIX)/share/games/$(TARGET)
72 rm $(PREFIX)/bin/$(TARGET)
75 make supertux SDL_MIXER= NOSOUNDFLAG=NOSOUND
78 make TARGET_DEF=WIN32 TARGET=supertux.exe \
80 cp /usr/local/cross-tools/i386-mingw32/lib/SDL*.dll .
84 -rm -f supertux supertux.exe
92 $(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(SDL_LIB)
96 obj/supertux.o: src/supertux.c src/defines.h src/globals.h \
97 src/setup.h src/intro.h src/title.h src/gameloop.h \
98 src/screen.h src/sound.h
99 $(CC) $(CFLAGS) src/supertux.c -c -o obj/supertux.o
101 obj/setup.o: src/setup.c src/setup.h \
102 src/defines.h src/globals.h src/screen.h
103 $(CC) $(CFLAGS) src/setup.c -c -o obj/setup.o
105 obj/intro.o: src/intro.c src/intro.h \
106 src/defines.h src/globals.h src/screen.h
107 $(CC) $(CFLAGS) src/intro.c -c -o obj/intro.o
109 obj/title.o: src/title.c src/title.h \
110 src/defines.h src/globals.h src/screen.h
111 $(CC) $(CFLAGS) src/title.c -c -o obj/title.o
113 obj/gameloop.o: src/gameloop.c src/gameloop.h \
114 src/defines.h src/globals.h src/screen.h src/sound.h \
116 $(CC) $(CFLAGS) src/gameloop.c -c -o obj/gameloop.o
118 obj/screen.o: src/screen.c src/defines.h src/globals.h src/screen.h
119 $(CC) $(CFLAGS) src/screen.c -c -o obj/screen.o
121 obj/sound.o: src/sound.c src/defines.h src/globals.h src/sound.h
122 $(CC) $(CFLAGS) src/sound.c -c -o obj/sound.o
124 obj/high_scores.o: src/high_scores.c src/defines.h src/globals.h \
126 $(CC) $(CFLAGS) src/high_scores.c -c -o obj/high_scores.o