File: Makefile

package info (click to toggle)
madbomber 0.2.5-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,656 kB
  • sloc: ansic: 3,734; sh: 78; makefile: 70
file content (95 lines) | stat: -rw-r--r-- 1,956 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Makefile for madbomber

# by Bill Kendrick
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/madbomber/

# October 25, 1999 - April 14, 2002


# User-definable stuff:

BIN_PREFIX=/usr/local/bin/
DATA_PREFIX=/usr/share/madbomber/


# Defaults for Linux:

TARGET=madbomber
TARGET_DEF=LINUX
SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)


# Sound-related definitions:

MIXER=-lSDL_mixer
IMAGE=-lSDL_image
NOSOUNDFLAG=__SOUND


# Stuff we pass to the compiler:

CFLAGS=-Wall -g $(SDL_CFLAGS) \
	-DDATA_PREFIX=\"$(DATA_PREFIX)\" -D$(NOSOUNDFLAG) -D$(TARGET_DEF)
SDL_LIB=$(MIXER) $(IMAGE) $(SDL_LDFLAGS)


# Debian hardening

CFLAGS += `dpkg-buildflags --get CFLAGS`
CFLAGS += `dpkg-buildflags --get CPPFLAGS`


# Make commands:

all:	$(TARGET)

install: install-arch install-indep

install-arch:
	cp madbomber $(BIN_PREFIX)
	chown root.root $(BIN_PREFIX)/madbomber
	chmod a+rx,g-w,o-w $(BIN_PREFIX)/madbomber

install-indep:
	mkdir -p $(DATA_PREFIX)
	cp -r data/images data/music data/sounds $(DATA_PREFIX)
	chown -R root.root $(DATA_PREFIX)
	chmod -R a+rX,g-w,o-w $(DATA_PREFIX)

nosound:
	make $(TARGET) MIXER= NOSOUNDFLAG=NOSOUND

win32:
	make TARGET_DEF=WIN32 TARGET=madbomber.exe \
		DATA_PREFIX=data/ IMAGE="-lSDL_image -lpng -lz"
	cp /usr/local/cross-tools/i386-mingw32/lib/SDL*.dll .
	chmod 644 SDL*.dll

embedded:
	make TARGET_DEF=EMBEDDED MIXER= \
		DATA_PREFIX=/opt/QtPalmtop/share/madbomber/ \
		SDL_LIB="/usr/local/arm/lib/libSDL_mixer.a /usr/local/arm/lib/libSDL.a -L/opt/Qtopia/sharp/lib -lpthread -lqpe -lqte" \
		CC=/usr/local/arm/bin/arm-linux-gcc
	/usr/local/arm/bin/arm-linux-strip ${TARGET}

emtest:
	make $(TARGET) TARGET_DEF=EMBEDDED DATA_PREFIX=e/

clean:
	-rm madbomber madbomber.exe
	-rm *.o
	-rm SDL*.dll
	-rm madbomber*.ipk


# Main executable:

$(TARGET):	madbomber.o
	$(CC) $(CFLAGS) madbomber.o -o $(TARGET) $(SDL_LIB) -lm $(LDFLAGS)


# Main object:

madbomber.o:	madbomber.c