File: Makefile

package info (click to toggle)
asylum 0.3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,424 kB
  • sloc: ansic: 7,476; makefile: 91; sh: 43
file content (102 lines) | stat: -rw-r--r-- 2,873 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
96
97
98
99
100
101
102
HOST=generic
#HOST=mingw
#HOST=haiku

CXX=g++
RM=rm -f
CFLAGS= -O3
COPTS=  $(CFLAGS) -funsigned-char \
	-DRESOURCEPATH=\"$(INSTALLRESOURCEPATH)\" \
	-DSCOREPATH=\"$(INSTALLHISCORES)\"
LIBS= -lm -lSDL -lSDL_mixer -lGL -lGLU
SRCS= alien.c asylum.c bullet.c file.c keyboard.c maze.c menus.c player.c projectile.c sound.c vdu.c

RESOURCES=data/Resources data/Ego data/Psyche data/Id data/Voices

INSTALLGROUP=games
CHGRP=chgrp
CHMOD=chmod

# For a non-root install, try something like this:
#
#INSTALLBIN=/home/blotwell/bin/asylum
#INSTALLRESOURCEPATH=/home/blotwell/lib/asylum
#INSTALLHISCORES=/home/blotwell/.asylum-hiscores
#
#INSTALLGROUP=foo
#CHGRP=echo
#CHMOD=echo
ifeq ($(HOST),haiku)
	CC=i586-pc-haiku-gcc
	COPTS+=$(CPPFLAGS) -D_NO_SOUND
	INSTALLBIN=/boot/common/games/asylum/asylum
	INSTALLRESOURCEPATH=/boot/common/games/asylum/data
	INSTALLHISCORES=/boot/common/games/asylum/hiscores
	OS_SOURCE=asylum_haiku.c
	LIBS=-lSDL_mixer -lSDL -lbe -lroot -ldevice -lgame -lGL -ltextencoding -lmedia
endif
ifeq ($(HOST),mingw)
	INSTALLBIN="c:/program files/asylum/asylum.exe"
	INSTALLRESOURCEPATH="c:/program files/asylum/data"
	INSTALLHISCORES="c:/program files/asylum/hiscores"
	OS_SOURCE=asylum_win.c
	RM=del
	EXE=.exe
	LIBS=-lm -lmingw32 -lSDL_mixer -lSDLmain -lSDL -mwindows
endif
ifeq ($(HOST),generic)
	INSTALLBIN=/usr/games/asylum
	INSTALLRESOURCEPATH=/usr/share/games/asylum
	INSTALLHISCORES=/var/games/asylum
endif

default: build

ifneq ($(HOST),mingw)
$(INSTALLBIN): asylum$(EXE) Makefile
	cp asylum$(EXE) $(INSTALLBIN)
	$(CHGRP) $(INSTALLGROUP) $(INSTALLBIN)
	$(CHMOD) g+s $(INSTALLBIN)
	$(CHMOD) a+x $(INSTALLBIN)

install-resources: $(RESOURCES) Makefile
	mkdir -p $(INSTALLRESOURCEPATH)
	cp -r $(RESOURCES) $(INSTALLRESOURCEPATH)/
	$(CHGRP) -R $(INSTALLGROUP) $(INSTALLRESOURCEPATH)/
	$(CHMOD) -R a+rX $(INSTALLRESOURCEPATH)/

install-hiscores: Makefile
	mkdir -p $(INSTALLHISCORES)
	touch $(INSTALLHISCORES)/EgoHighScores
	touch $(INSTALLHISCORES)/PsycheHighScores
	touch $(INSTALLHISCORES)/IdHighScores
	touch $(INSTALLHISCORES)/ExtendedHighScores
	$(CHGRP) -R $(INSTALLGROUP) $(INSTALLHISCORES)/*
	$(CHMOD) -R 660 $(INSTALLHISCORES)/*

install-binary: $(INSTALLBIN)

install: install-resources install-hiscores install-binary

uninstall:
	rm -rf $(INSTALLBINARY) $(INSTALLRESOURCEPATH) $(INSTALLHISCORES)
endif

oggs:
	bash -c 'pushd data; for i in */Music?; do pushd ..; ./asylum --dumpmusic $$i `if (echo \$$i|grep Resources.Music2>/dev/null); then echo -n --slower; fi`; \
	popd;\
	tail -c +33 $$i.au| \
	oggenc - --raw --raw-endianness=1 --raw-rate=22050 --artist="Andy Southgate" \
	--album="Background music for Asylum computer game" \
	>$$i.ogg;\
	rm $$i.au;\
	done; popd'

build: asylum$(EXE)

asylum$(EXE): $(SRCS) $(OS_SOURCE) asylum.h Makefile
	$(CXX) $(COPTS) $(LDFLAGS) -o asylum$(EXE) $(SRCS) $(OS_SOURCE) $(LIBS)

clean:
	$(RM) asylum$(EXE)