-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
150 lines (119 loc) · 3.26 KB
/
Makefile
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# $Id: Makefile,v 1.36 2005/12/08 12:38:48 sec Exp $
#Config this:
CFLAGS?=-O -pipe
CFLAGS+=-Wall
# And perhaps this
PREFIX?=/usr/X11R6
BINDIR?=${PREFIX}/bin
DATADIR?=${PREFIX}/share/brillion
DATE=`date +%Y-%m-%d`
.if exists(.config)
.include ".config"
.else
config:
${MAKE}
.endif
.if exists(.version)
.include ".version"
.endif
# It shouldn't be necessary to edit anything below this line.
PRG=brillion
OBJ=brillion.o graphics.o level.o physics.o play.o game.o effects.o \
save.o font.o title.o score.o timer.o portab.o
SRCS=brillion.c graphics.c level.c physics.c play.c game.c effects.c \
save.c font.c title.c score.c timer.c portab.c
.ifdef OPTIMIZE
CFLAGS=-O3 -ffast-math -fforce-addr -fomit-frame-pointer -pipe -DNDEBUG
.endif
.ifdef DEVEL
CFLAGS+=-g -DDEVEL
VERS?=CVS
VERS+=(devel)
.endif
# misses -pedantic (warns too much about system headers)
.ifdef PEDANTIC
#CFLAGS+= -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2
CFLAGS+= -D_POSIX_C_SOURCE=199506L -pedantic
CFLAGS+= -ansi -W -Wall -Wcast-align \
-Wbad-function-cast -Wcast-qual -Wchar-subscripts -Winline \
-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
.endif
.ifdef SOUND
CFLAGS+=-DSOUND
LDFLAGS+=-lSDL_mixer
OBJ+=music.o
.endif
SRCS+=music.c
.ifdef WINDOWS
OBJ+=res.o
.endif
.ifdef DMALLOC_OPTIONS
CFLAGS+=-I/usr/local/include/ -DDMALLOC
LDFLAGS+=-L/usr/local/lib/ -ldmalloc
.endif
.ifdef PROFILE
CFLAGS+=-pg
LDFLAGS+=-pg
LDFLAGS=-pg -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL-1.1_p -lc_r -lSDL_image
LDFLAGS+=-static -L/usr/X11R6/lib -lesd -laa -lncurses -lXext -lvga -lSDL-1.1 -lX11 -lpng -ltiff -lz -ljpeg -lm -lvgl -lusbhid
.endif
CFLAGS+=`${SDL_CONFIG} --cflags`
LDFLAGS+=`${SDL_CONFIG} --libs`
CFLAGS+= -DBDATADIR=${DATADIR}
LDFLAGS+=-lSDL_image
.ifdef VERS
CFLAGS+= -DPROG_VERSION="\"${VERS}\""
.endif
.if ${USER} == "sec"
all: tags
.endif
all: $(PRG)
$(PRG): $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $@
clean:
rm -f $(PRG) $(OBJ) *core Original/*core
tags: brillion.c brillion.h graphics.c level.c physics.c play.c
-ctags *.[ch]
.ifdef WINDOWS
res.o: res.rc brillion.ico
windres -i $< -o $@
# Requires the nullsoft installer: http://sourceforge.net/projects/nsis/
installer: release clean $(PRG)
strip brillion.exe
perl -p -e s/%VER%/$(DATE)/ brillion.nsi>now.nsi
/cygdrive/c/Programme/NSIS/makensis now.nsi
rm -f now.nsi
winput:
ncftpput upload.sourceforge.net incoming Brillion-Setup-$(DATE).exe
put: winput
.else
install: $(PRG)
strip $(PRG)
cp $(PRG) ${BINDIR}
-mkdir ${DATADIR}
cp -r Original ${DATADIR}
.endif
archive: release
-rm -rf brillion-$(DATE)
mkdir brillion-$(DATE)
cp -pr INSTALL THANKS Makefile $(SRCS) brillion.h brillion.ico brillion.nsi res.rc GNUify .version config.sh GNUmakefile Original/ brillion-$(DATE)
tar --exclude Original/Scores --exclude CVS -cvzf brillion-$(DATE).tgz brillion-$(DATE)
rm -rf brillion-$(DATE)
release:
echo VERS=${DATE} >.version
put:
ncftpput upload.sourceforge.net incoming brillion-$(DATE).tgz
.depend: brillion.c brillion.h graphics.c level.c physics.c play.c game.c
-$(CC) $(CFLAGS) -MM *.c>.depend
devel: gnu tags .depend
depend: .depend
config: .config
.config: # Makefile
./config.sh
gnu: GNUmakefile
GNUmakefile: Makefile GNUify
./GNUify
.if exists(.depend)
.include ".depend"
.endif