File: Makefile

package info (click to toggle)
xtrojka 123-12
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 492 kB
  • ctags: 443
  • sloc: ansic: 3,087; makefile: 135; sh: 19
file content (173 lines) | stat: -rw-r--r-- 5,689 bytes parent folder | download | duplicates (2)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#
# @(#) Makefile for XTrojka
#

#############################################################################
#
#	GENERAL
#
PROGS= xtrojka
#					xtrojka version (do not change!)
VERSION=123
#					where to put the binary
TARGET_DIR=/usr/games
#					where to put the manpage
MANDIR=/usr/man/man6
#					the location of the highscorefile
HSFILE=/var/lib/games/xtrojka.scores
#					your favourite packer
COMPRESS=gzip -v9
#					your favourite c-compiler
CC=gcc
#					used X libraries
XLIBS= -lXaw -lXmu -lXt -lX11 -lXext
#					some more X libraries
RESGEN=./resgen

##############################################################################
#
#	FILE SETS
#

SRCS=	xtrojka.c tr_core.c game.c menu_tool.c window.c pics.c screen.c \
	sh_main.c sh_slist.c sh_stat.c \
	menu.c scores.c slist.c preferences.c options.c actions.c

OBJS=$(SRCS:.c=.o)

OTHER=Makefile XTrojka.* *.h bitmaps pixmaps AUTHOR COPYRIGHT MANIFEST README \
	resgen xtrojka.man YIKES xtrojka$(VERSION).lsm 

###########################################################################
#
#	SYSTEM OPTIONS
#

HSF=-DSCOREFILE='"$(HSFILE)"'
#
#	comment out your favorite system (the one you use, that is...)
#
#					search the libaries here
LIBPATH=-L/usr/X11R6/lib
#					doesn't work too well on all systems
#LCK=-DLOCKING
#					add debug info
#DBG=-DDEBUG_INFO
#					use slick graphics (multi-color-xpm)
XPM=-DXPM
XPMLIB=-lXpm

#	Comment out the options for the system you use

#
# Sunos 4.1.3
#
#XDIR=-I/usr/openwin/include
#LIBS=-lm
#SYS=-DSUNOS4
#
# Solaris 
#
#XDIR=-I/usr/openwin/include
#LIBS=-lnsl
#SYS=-DSUNOS5

#
# Linux
#
SYS=-DLINUX

#
#
#
CFLAGS= $(XDIR) $(DBG) $(XPM) $(SYS) $(OPT) $(HSF) $(LCK) $(LIBPATH) 

###########################################################################
#
#	COMMANDS
#

all: 	$(PROGS)

xtrojka: $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) $(LIBS) $(XPMLIB) $(XLIBS) -o xtrojka

tag:
	ctags $(SRCS)

tar:
	rm -rf xtrojka$(VERSION);	\
	mkdir xtrojka$(VERSION);	\
	cp -r $(SRCS) $(OTHER) xtrojka$(VERSION);	\
	rm -f xtrojka$(VERSION)/_*.h;		\
	tar cvf xtrojka$(VERSION).tar xtrojka$(VERSION);	\
	$(COMPRESS) xtrojka$(VERSION).tar;	\
	rm -rf xtrojka$(VERSION);

install:
	@echo $(HSFILE)|sed -e 's/\//\\\//g'>hsn; \
	sed -e "s/__SCOREDIR__/`cat hsn`/g" xtrojka.man > xtrojka.6; \
	install -d $(PREFIX)/$(MANDIR) $(PREFIX)/$(TARGET_DIR) $(PREFIX)/var/lib/games/
	cp xtrojka.6 $(PREFIX)/$(MANDIR); 
	install -s xtrojka $(PREFIX)/$(TARGET_DIR);
#	touch $(PREFIX)/$(HSFILE);
	install -d $(PREFIX)/usr/X11R6/lib/X11/app-defaults
	cp XTrojka $(PREFIX)/usr/X11R6/lib/X11/app-defaults
	
clean:
	rm -rf tags *.o core xtrojka xtrojka.6 hsn
	
##############################################################################
#
#	DEPENDENCIES
#

_strdefs.h _resdefs.h:	XTrojka 
	$(RESGEN)

actions.o: actions.c actions.h xtrojka.h debug.h
game.o: game.c game.h xtrojka.h sh_main.h sh_stat.h scores.h menu.h menu_tool.h \
  debug.h tr_core.h screen.h
menu.o: menu.c debug.h xtrojka.h tr_core.h menu.h menu_tool.h game.h sh_main.h
menu_tool.o: menu_tool.c xtrojka.h tr_core.h menu_tool.h menu.h debug.h
options.o: options.c xtrojka.h debug.h
pics.o: pics.c xtrojka.h tr_core.h pics.h window.h debug.h pictures.h \
  bitmaps/block0 bitmaps/block1 bitmaps/block2 bitmaps/block3 bitmaps/block4 \
  bitmaps/block5 bitmaps/pat1 bitmaps/pat2 bitmaps/pat3 bitmaps/pat4 \
  bitmaps/pat5 bitmaps/leftpillar bitmaps/rightpillar bitmaps/new \
  bitmaps/title bitmaps/app_icon bitmaps/stat_icon pixmaps/block1 \
  pixmaps/block2 pixmaps/block3 pixmaps/block4 pixmaps/block5 \
  pixmaps/leftpillar pixmaps/rightpillar
preferences.o: preferences.c debug.h xtrojka.h tr_core.h preferences.h 
scores.o: scores.c debug.h xtrojka.h tr_core.h scores.h slist.h sh_slist.h \
  _strdefs.h
screen.o: screen.c screen.h debug.h xtrojka.h tr_core.h
sh_main.o: sh_main.c debug.h xtrojka.h tr_core.h screen.h sh_slist.h sh_main.h \
  window.h pictures.h bitmaps/block0 bitmaps/block1 bitmaps/block2 \
  bitmaps/block3 bitmaps/block4 bitmaps/block5 bitmaps/pat1 bitmaps/pat2 \
  bitmaps/pat3 bitmaps/pat4 bitmaps/pat5 bitmaps/leftpillar \
  bitmaps/rightpillar bitmaps/new bitmaps/title bitmaps/app_icon \
  bitmaps/stat_icon pixmaps/block1 pixmaps/block2 pixmaps/block3 \
  pixmaps/block4 pixmaps/block5 pixmaps/leftpillar pixmaps/rightpillar menu.h \
  menu_tool.h
sh_slist.o: sh_slist.c sh_slist.h xtrojka.h screen.h window.h font.h scores.h \
  pictures.h bitmaps/block0 bitmaps/block1 bitmaps/block2 bitmaps/block3 \
  bitmaps/block4 bitmaps/block5 bitmaps/pat1 bitmaps/pat2 bitmaps/pat3 \
  bitmaps/pat4 bitmaps/pat5 bitmaps/leftpillar bitmaps/rightpillar bitmaps/new \
  bitmaps/title bitmaps/app_icon bitmaps/stat_icon pixmaps/block1 \
  pixmaps/block2 pixmaps/block3 pixmaps/block4 pixmaps/block5 \
  pixmaps/leftpillar pixmaps/rightpillar slist.h debug.h tr_core.h _strdefs.h
sh_stat.o: sh_stat.c sh_stat.h debug.h xtrojka.h tr_core.h screen.h window.h \
  pictures.h bitmaps/block0 bitmaps/block1 bitmaps/block2 bitmaps/block3 \
  bitmaps/block4 bitmaps/block5 bitmaps/pat1 bitmaps/pat2 bitmaps/pat3 \
  bitmaps/pat4 bitmaps/pat5 bitmaps/leftpillar bitmaps/rightpillar bitmaps/new \
  bitmaps/title bitmaps/app_icon bitmaps/stat_icon pixmaps/block1 \
  pixmaps/block2 pixmaps/block3 pixmaps/block4 pixmaps/block5 \
  pixmaps/leftpillar pixmaps/rightpillar _strdefs.h
slist.o: slist.c debug.h xtrojka.h slist.h scores.h sh_slist.h
tr_core.o: tr_core.c tr_core.h
window.o: window.c window.h tr_core.h sh_slist.h sh_stat.h debug.h xtrojka.h
xtrojka.o: xtrojka.c xtrojka.h scores.h options.h preferences.h sh_slist.h \
  sh_stat.h game.h menu_tool.h menu.h window.h pics.h slist.h actions.h debug.h \
  tr_core.h _strdefs.h _resdefs.h