~swag/armagetronad/0.2.9-sty+ct+ap-fork

1 by luke-jr
Unify tags/branches of modules released together
1
# Parts of the makefile that are not handled by automake
2
##################
3
# Beautification #
4
##################
5
6
# use this target if you're OK with the project's defaults and
7
# want updated file timestamps
8
rebeautify:
494 by z-man
Disabling astyle for now. More trouble than it is worth with its changed default behavior.
9
#	ARTISTIC_STYLE_OPTIONS=$(srcdir)/config/astylerc sh $(srcdir)/batch/make/beautify -t $(srcdir) .beautytag.re
1 by luke-jr
Unify tags/branches of modules released together
10
11
# use this target if you want to switch between your settings
12
# (beautify-personal) and the project defaults to get back to
13
# the defaults (timestamps stay untouched)
14
beautify:
15
	rm -f $(srcdir)/.beautytag.personal
494 by z-man
Disabling astyle for now. More trouble than it is worth with its changed default behavior.
16
#	ARTISTIC_STYLE_OPTIONS=$(srcdir)/config/astylerc sh $(srcdir)/batch/make/beautify $(srcdir) .beautytag
1 by luke-jr
Unify tags/branches of modules released together
17
18
# use this target to run astyle with your personal settings for
11 by luke-jr
More migration to Subversion
19
# it (but remember to do "make beautify" before comitting to Subversion!)
1 by luke-jr
Unify tags/branches of modules released together
20
beautify-personal:
21
	rm -f $(srcdir)/.beautytag $(srcdir)/.beautytag.re
494 by z-man
Disabling astyle for now. More trouble than it is worth with its changed default behavior.
22
#	ARTISTIC_STYLE_OPTIONS=~/.astylerc sh $(srcdir)/batch/make/beautify $(srcdir) .beautytag.personal 
1 by luke-jr
Unify tags/branches of modules released together
23
24
##########
25
# Checks #
26
##########
27
28
destdir.inst=/destdir
29
destdir.inst2=/destdir
30
destdir.inst3=
31
32
predistcheckclean=rm -rf ._$* .leftover.$* .help .doc
33
# checks whether installation and uninstallation works fine
34
installcheck_install.%:
35
	$(predistcheckclean)
36
	mkdir ._$*
37
38
#   simulate old data to migrate
39
	mkdir -p ._$*/@oldvardir@
40
	echo "Z-Man was here" > ._$*/@oldvardir@/users.txt
41
42
#	install into destdir
43
	ARMAGETRONAD_INSTALL_TESTING="yes" DESTDIR=`pwd`/._$*$(destdir.$*) ROOTDIR=`pwd`/._$* $(MAKE) install
44
45
#	install fake rc.config
46
	echo "user=$(USER)" >> ._$*$(destdir.$*)/$(aa_sysconfdir)/rc.config
47
	echo "niceness_level=5" >> ._$*$(destdir.$*)/$(aa_sysconfdir)/rc.config
48
#   echo "VARDIR=$$(pwd)/._$*/${localstatedir}" >> ._$*/destdir/$(aa_sysconfdir)/rc.config
49
50
#	delete old configuration and prune empty directories
51
	rm -rf ._$*@oldvardir@
319 by z-man
Fixed warinigs of "find".
52
	for d in `find ._$* -depth -type d`; do rmdir $$d; done > /dev/null 2>&1 || true
1 by luke-jr
Unify tags/branches of modules released together
53
54
#   move to final destination
55
	mv -f ._$*$(destdir.$*)/* ._$*/ || true
56
	rmdir ._$*$(destdir.$*) || true
57
313 by z-man
Adapted installcheck target to possible absence of sysinstall script.
58
if USE_SYSINSTALL
1 by luke-jr
Unify tags/branches of modules released together
59
	test -r	._$*/@aa_localstatedir@/users.txt
313 by z-man
Adapted installcheck target to possible absence of sysinstall script.
60
endif
1 by luke-jr
Unify tags/branches of modules released together
61
62
installcheck_run_%: installcheck_install_%
63
	@echo "Testing executable..."
64
	cd ._$*; ./$(bindir)/@progname@
65
66
installcheck_test.%: installcheck_install.%
67
	@echo "Testing executable..."
68
if BUILDMAIN
69
	cd ._$*; ./$(bindir)/@progname@ --help > .help
70
	test -s ._$*/.help
71
	cd ._$*; ./$(bindir)/@progname@ --doc > .doc
72
	test -s ._$*/.doc
73
endif
74
	rm -rf ._$*/var
75
	rm -rf ._$*/${localstatedir}
76
if USE_SYSINSTALL
77
if BUILDMASTER
78
	@echo "Testing master server starter script..."
79
	@cd ._$*; ./$(initdir)/@prognamebase@-master start
80
	@cd ._$*; ./$(initdir)/@prognamebase@-master status || { sleep 5; ./$(initdir)/@prognamebase@-master status; }
81
	@cd ._$*; ./$(initdir)/@prognamebase@-master restart
82
	@cd ._$*; ./$(initdir)/@prognamebase@-master status || { sleep 5; ./$(initdir)/@prognamebase@-master status; }
83
	@cd ._$*; ./$(initdir)/@prognamebase@-master stop
84
	@sleep 1
85
	@cd ._$*; ./$(initdir)/@prognamebase@-master stop || true
86
	@cd ._$*; if ./$(initdir)/@prognamebase@-master status; then exit 1; else echo "Success!"; fi
87
endif
88
if BUILDDEDICATED
89
	@echo "Testing server starter script..."
90
	@cd ._$*; ./$(initdir)/@progname@ start
91
	@cd ._$*; ./$(initdir)/@progname@ status || { sleep 5; ./$(initdir)/@progname@ status; }
92
	@cd ._$*; ./$(initdir)/@progname@ restart
93
	@cd ._$*; ./$(initdir)/@progname@ status || { sleep 5; ./$(initdir)/@progname@ status; }
94
	@cd ._$*; ./$(initdir)/@progname@ stop
95
	@sleep 1
96
	@cd ._$*; ./$(initdir)/@progname@ stop || true
97
	@cd ._$*; if ./$(initdir)/@progname@ status; then exit 1; else echo "Success!"; fi
98
#   for testing the stop-on-uninstall code
99
#   @cd ._$*; ./$(initdir)/@progname@ start
100
endif
101
endif
102
103
installcheck_douninstall.inst:
104
	DESTDIR=`pwd`/._inst $(MAKE) uninstall
105
106
installcheck_uninstall.inst: installcheck_test.inst
563.24.114 by Manuel Moos
Disabling uninstallation check if uninstall script is not built.
107
1 by luke-jr
Unify tags/branches of modules released together
108
installcheck_uninstall.%: installcheck_install.%
109
	rm -rf ._$*/${localstatedir} ._$*/.doc ._$*/.help ._$*/leak.log ._$*/memprofile*.txt ._$*/gmon.out ._$*/@logdir@
110
	$(MAKE) installcheck_douninstall.$*
111
	find ._$* -type f -exec echo leftover file \{\} >> .leftover.$* \;
112
	find ._$* -type l -exec echo leftover link \{\} >> .leftover.$* \;
113
	if test -s .leftover.$*; then cat .leftover.$*; false; else true; fi
114
	rm -f .leftover.$*
115
563.24.114 by Manuel Moos
Disabling uninstallation check if uninstall script is not built.
116
if USE_UNINSTALL
117
installcheck_douninstall.inst2:
118
	./._inst2/$(bindir)/${uninstaller}
119
	find ._inst2 -mindepth 1 -type d -name ${progname} -exec echo leftover directory \{\} >> .leftover.inst2 \;
120
121
installcheck_douninstall.inst3:
122
	./._inst3/$(bindir)/${uninstaller}
123
	find ._inst3 -mindepth 1 -type d -name ${progname} -exec echo leftover directory \{\} >> .leftover.inst3 \;
124
563.39.1 by Manuel Moos
Fixing strange automake warning, complaining about installcheck target inside conditionals.
125
myinstallcheck: installcheck_uninstall.inst installcheck_uninstall.inst2
563.24.114 by Manuel Moos
Disabling uninstallation check if uninstall script is not built.
126
else
563.39.1 by Manuel Moos
Fixing strange automake warning, complaining about installcheck target inside conditionals.
127
myinstallcheck: installcheck_uninstall.inst
563.24.114 by Manuel Moos
Disabling uninstallation check if uninstall script is not built.
128
endif
1 by luke-jr
Unify tags/branches of modules released together
129
	$(predistcheckclean)
130
	@echo -e "\n---------------------------------------\nInstallation and uninstallation worked!\n---------------------------------------\n"
131
563.39.1 by Manuel Moos
Fixing strange automake warning, complaining about installcheck target inside conditionals.
132
installcheck: myinstallcheck
133
devcheck: beautify myinstallcheck
11 by luke-jr
More migration to Subversion
134
fullcheck: beautify devcheck distcheck
1 by luke-jr
Unify tags/branches of modules released together
135
314 by z-man
Replaced appending .. with call to dirname. Doesn't work in all situations, but the result doesn't matter much anyway.
136
# run all that don't require a full rebuild
137
test: installcheck
138
7 by z-man
fully switched to svn.
139
###############
140
# Fingerprint #
141
###############
1 by luke-jr
Unify tags/branches of modules released together
142
8 by z-man
fixed distcheck
143
# initial rule for source change tag (make it really old)
7 by z-man
fully switched to svn.
144
.changetag:
8 by z-man
fixed distcheck
145
	touch -t 7001010101 $@
7 by z-man
fully switched to svn.
146
147
# make snapshot of SVN state, tracking relevant changes in .changetag
148
fingerprint: .changetag
563.1.410 by Manuel Moos
ChangeLog and fingerprint are now generated from bzr, too.
149
# easy, just do svn info, that contains all the information needed. If that fails, try other scms.
150
	svn info ${top_srcdir} > $@ || svk info ${top_srcdir} > $@ || { bzr testament ${top_srcdir}; bzr info ${top_srcdir};  } > $@ || echo "unknown" > $@
318 by z-man
fingerprint now also supports svk and has a safe fallback.
151
	svn info `dirname ${top_srcdir}` >> @$ || svn info `dirname ${top_srcdir}` >> $@ || echo "unknown" >> $@
7 by z-man
fully switched to svn.
152
	diff $@ .changetag > /dev/null 2>&1 || cp $@ .changetag
153
154
########################
155
# tracking changes     #
156
########################
157
158
# change version on deliberate version edit
159
$(srcdir)/version: $(wildcard $(srcdir)/*_version) .changetag
1 by luke-jr
Unify tags/branches of modules released together
160
	echo "m4_define(AUTOMATIC_VERSION,["`sh $(srcdir)/batch/make/version $(srcdir)`"])" > $@
161
162
# Keep the changelog up to date as well (triggered by make dist only)
7 by z-man
fully switched to svn.
163
$(srcdir)/ChangeLog: .changetag
1 by luke-jr
Unify tags/branches of modules released together
164
	touch $@
3 by z-man
Switched form cvs2cl to svn log. svn2cl eats the whole memory, then dies.
165
	rm -f $@
563.1.410 by Manuel Moos
ChangeLog and fingerprint are now generated from bzr, too.
166
	@echo -e "\nGenerating ChangeLog from SVN/BZR, please be patient...\n"
563.24.45 by z-man
Supporting rebranding on packaging.
167
	cd ${srcdir}; svn log 2>&1 > ChangeLog || bzr log --gnu-changelog 2>&1 > ChangeLog || echo "No official releasse: no changelog" > ChangeLog
3 by z-man
Switched form cvs2cl to svn log. svn2cl eats the whole memory, then dies.
168
	test -r $@ || touch $@
1 by luke-jr
Unify tags/branches of modules released together
169
7 by z-man
fully switched to svn.
170
# extra target to make before a real distribution is built
171
# triggers regeneration of ChangeLog and version
172
distprep:
173
# rebuild fingerprint and update source change tag that way
174
	if test -d ${srcdir}/.svn; then rm -f fingerprint; $(MAKE) fingerprint; fi
1 by luke-jr
Unify tags/branches of modules released together
175
176
#############
177
# Debugging #
178
#############
179
180
.gdbinit:
181
	echo "break st_Breakpoint()" > $@
182
183
@progname@: all
334 by z-man
Solaris compatibility: only create symbolic links if they don't exist yet.
184
	test -r $@ || ln -sf src/armagetronad_main $@
1 by luke-jr
Unify tags/branches of modules released together
185
186
DEBUGFILES=.gdbinit @progname@
187
debug: $(DEBUGFILES)
188
189
run: debug all
190
	./@progname@
191
192
debugclean:
193
	rm -rf @progname@ @prognamebase@ $(DEBUGFILES) leak.log memprofile*.txt
194
195
debugdistclean:
196
	rm -rf var
197
198
clean-local: debugclean
199
200
distclean-local: debugdistclean