-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (63 loc) · 2.13 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
CC=gcc -Wall -O2 -g $$(freetype-config --cflags)
W_DIR=src/weaver/
PROG=spacewar
WEAVER_OBJ=display.o keyboard.o vector2.o vector3.o vector4.o weaver.o sound.o image.o font.o
PROG_OBJ=ai.o shot.o dust.o camera.o ships.o star.o game.o
PROG_HEAD=src/ai.h src/shot.h src/dust.h src/camera.h src/ships.h src/star.h src/game.h
INSTALL_DIR=/usr/games
DATA_DIR=/usr/share/games/spacewar
#######################################################
all: ${WEAVER_OBJ} ${PROG_OBJ}
${CC} ${CFLAGS} -g -o ${PROG} ${WEAVER_OBJ} ${PROG_OBJ} -lX11 -lXext -lm -lvorbisfile -lasound -lpng -lfreetype $$(freetype-config --cflags)
#GAME_START
game.o: src/game.c ${PROG_HEAD}
${CC} -c src/game.c
star.o: src/star.c ${PROG_HEAD}
${CC} -c src/star.c
ships.o: src/ships.c ${PROG_HEAD}
${CC} -c src/ships.c
camera.o: src/camera.c ${PROG_HEAD}
${CC} -c src/camera.c
dust.o: src/dust.c ${PROG_HEAD}
${CC} -c src/dust.c
shot.o: src/shot.c ${PROG_HEAD}
${CC} -c src/shot.c
ai.o: src/ai.c ${PROG_HEAD}
${CC} -c src/ai.c
#GAME_END
#WEAVER_START
image.o: src/weaver/image.c src/weaver/image.h
${CC} -c src/weaver/image.c
display.o: src/weaver/display.c src/weaver/display.h
${CC} -c src/weaver/display.c
keyboard.o: src/weaver/keyboard.c src/weaver/keyboard.h
${CC} -c src/weaver/keyboard.c
vector2.o: src/weaver/vector2.c src/weaver/vector2.h
${CC} -c src/weaver/vector2.c
vector3.o: src/weaver/vector3.c src/weaver/vector3.h
${CC} -c src/weaver/vector3.c
vector4.o: src/weaver/vector4.c src/weaver/vector4.h
${CC} -c src/weaver/vector4.c
weaver.o: src/weaver/weaver.c src/weaver/weaver.h
${CC} -c src/weaver/weaver.c
sound.o: src/weaver/sound.c src/weaver/sound.h
${CC} -c src/weaver/sound.c
font.o: src/weaver/font.c src/weaver/font.h
${CC} -c src/weaver/font.c
#WEAVER_END
clean:
rm -rf *~ *.o ./\#*
#######################################################
install:
install -d ${DATA_DIR}
install -D -s ${PROG} ${INSTALL_DIR}/${PROG}
strip -s ${INSTALL_DIR}/${PROG}
cp -r sound ${DATA_DIR}/
cp -r images ${DATA_DIR}/
cp -r fonts ${DATA_DIR}/
cp -r music ${DATA_DIR}/
chmod a+x ${DATA_DIR}/*
chmod -R a+r ${DATA_DIR}/
uninstall:
rm -rf ${INSTALL_DIR}/${PROG}
rm -rf ${DATA_DIR}/