File: Makefile

package info (click to toggle)
defendguin 0.0.12-7
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 4,112 kB
  • sloc: ansic: 4,257; makefile: 105; sh: 22
file content (70 lines) | stat: -rw-r--r-- 1,516 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
# Makefile for defendguin

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

# November 6, 1999 - January 29, 2006


# User-definable stuff:

CFLAGS=-Wall -O2
#DATA_PREFIX=$(PWD)/data/
PREFIX=$(DESTDIR)/usr
MAN_PREFIX=$(PREFIX)/share/man/man6
BIN_PREFIX=$(PREFIX)/games
DATA_PREFIX=$(PREFIX)/share/games/defendguin/
JOY=YES


# Other definitions:

SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs) -L/usr/X11R6/lib
MIXER=-lSDL_mixer
NOSOUNDFLAG=__SOUND
CFLAGS= $(DEB_CFLAGS) $(SDL_CFLAGS) \
	-DDATA_PREFIX=\"$(DATA_PREFIX)\" -D$(NOSOUNDFLAG) -DJOY_$(JOY)
SDL_LIB=$(SDL_LDFLAGS) $(MIXER)


# Make commands:

all:	defendguin

nosound:
	make defendguin MIXER= NOSOUNDFLAG=NOSOUND

install:	defendguin
	install -d $(DATA_PREFIX)
	-rm data/images/loader/loading-orig.bmp.gz
	cp -R data/* $(DATA_PREFIX)
	chmod -R a+rX,g-w,o-w $(DATA_PREFIX)
	-mkdir -p $(BIN_PREFIX)
	cp defendguin $(BIN_PREFIX)/
	chmod a+rx,g-w,o-w $(BIN_PREFIX)/defendguin
	-mkdir -p $(MAN_PREFIX)
	cp src/defendguin.6 $(MAN_PREFIX)/
	chmod a+rx,g-w,o-w $(MAN_PREFIX)/defendguin.6

uninstall:
	-rm -r $(DATA_PREFIX)
	-rm $(BIN_PREFIX)/defendguin
	-rm $(MAN_PREFIX)/defendguin.6

clean:
	-rm defendguin
	-rm obj/*.o


# Main executable:

defendguin:	obj/defendguin.o
	$(CC) $(CFLAGS) $(CPPFLAGS) obj/defendguin.o -o defendguin $(SDL_LIB) -lm $(LDFLAGS)


# Main object:

obj/defendguin.o:	src/defendguin.c
	$(CC) $(CFLAGS)	$(CPPFLAGS) src/defendguin.c -c -o obj/defendguin.o