~vitty/armagetronad/trunk-armagetronad-breakpad

1 by luke-jr
Unify tags/branches of modules released together
1
# Parts of the makefile that are not handled by automake
406 by z-man
Merging branch 0.2.8 from revision 6778 to 6798:
2
1 by luke-jr
Unify tags/branches of modules released together
3
##################
4
# Beautification #
5
##################
6
7
# use this target if you're OK with the project's defaults and
8
# want updated file timestamps
9
rebeautify:
589 by z-man
Merging branch 0.2.8 from revision 7539 to 7702:
10
#	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
11
12
# use this target if you want to switch between your settings
13
# (beautify-personal) and the project defaults to get back to
14
# the defaults (timestamps stay untouched)
15
beautify:
16
	rm -f $(srcdir)/.beautytag.personal
589 by z-man
Merging branch 0.2.8 from revision 7539 to 7702:
17
#	ARTISTIC_STYLE_OPTIONS=$(srcdir)/config/astylerc sh $(srcdir)/batch/make/beautify $(srcdir) .beautytag
1 by luke-jr
Unify tags/branches of modules released together
18
19
# use this target to run astyle with your personal settings for
21 by z-man
Merging branch 0.2.8 from revision 4640 to 4667:
20
# it (but remember to do "make beautify" before comitting to Subversion!)
1 by luke-jr
Unify tags/branches of modules released together
21
beautify-personal:
22
	rm -f $(srcdir)/.beautytag $(srcdir)/.beautytag.re
589 by z-man
Merging branch 0.2.8 from revision 7539 to 7702:
23
#	ARTISTIC_STYLE_OPTIONS=~/.astylerc sh $(srcdir)/batch/make/beautify $(srcdir) .beautytag.personal 
1 by luke-jr
Unify tags/branches of modules released together
24
25
##########
26
# Checks #
27
##########
28
29
destdir.inst=/destdir
30
destdir.inst2=/destdir
31
destdir.inst3=
32
33
predistcheckclean=rm -rf ._$* .leftover.$* .help .doc
34
# checks whether installation and uninstallation works fine
35
installcheck_install.%:
36
	$(predistcheckclean)
37
	mkdir ._$*
38
39
#   simulate old data to migrate
40
	mkdir -p ._$*/@oldvardir@
41
	echo "Z-Man was here" > ._$*/@oldvardir@/users.txt
42
43
#	install into destdir
44
	ARMAGETRONAD_INSTALL_TESTING="yes" DESTDIR=`pwd`/._$*$(destdir.$*) ROOTDIR=`pwd`/._$* $(MAKE) install
45
46
#	install fake rc.config
47
	echo "user=$(USER)" >> ._$*$(destdir.$*)/$(aa_sysconfdir)/rc.config
48
	echo "niceness_level=5" >> ._$*$(destdir.$*)/$(aa_sysconfdir)/rc.config
49
#   echo "VARDIR=$$(pwd)/._$*/${localstatedir}" >> ._$*/destdir/$(aa_sysconfdir)/rc.config
50
51
#	delete old configuration and prune empty directories
52
	rm -rf ._$*@oldvardir@
414 by z-man
Merging branch 0.2.8 from revision 6800 to 6803:
53
	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
54
55
#   move to final destination
56
	mv -f ._$*$(destdir.$*)/* ._$*/ || true
57
	rmdir ._$*$(destdir.$*) || true
58
406 by z-man
Merging branch 0.2.8 from revision 6778 to 6798:
59
if USE_SYSINSTALL
1 by luke-jr
Unify tags/branches of modules released together
60
	test -r	._$*/@aa_localstatedir@/users.txt
406 by z-man
Merging branch 0.2.8 from revision 6778 to 6798:
61
endif
1 by luke-jr
Unify tags/branches of modules released together
62
63
installcheck_run_%: installcheck_install_%
64
	@echo "Testing executable..."
65
	cd ._$*; ./$(bindir)/@progname@
66
67
installcheck_test.%: installcheck_install.%
68
	@echo "Testing executable..."
69
if BUILDMAIN
70
	cd ._$*; ./$(bindir)/@progname@ --help > .help
71
	test -s ._$*/.help
72
	cd ._$*; ./$(bindir)/@progname@ --doc > .doc
73
	test -s ._$*/.doc
74
endif
75
	rm -rf ._$*/var
76
	rm -rf ._$*/${localstatedir}
77
if USE_SYSINSTALL
78
if BUILDMASTER
79
	@echo "Testing master server starter script..."
80
	@cd ._$*; ./$(initdir)/@prognamebase@-master start
81
	@cd ._$*; ./$(initdir)/@prognamebase@-master status || { sleep 5; ./$(initdir)/@prognamebase@-master status; }
82
	@cd ._$*; ./$(initdir)/@prognamebase@-master restart
83
	@cd ._$*; ./$(initdir)/@prognamebase@-master status || { sleep 5; ./$(initdir)/@prognamebase@-master status; }
84
	@cd ._$*; ./$(initdir)/@prognamebase@-master stop
85
	@sleep 1
86
	@cd ._$*; ./$(initdir)/@prognamebase@-master stop || true
87
	@cd ._$*; if ./$(initdir)/@prognamebase@-master status; then exit 1; else echo "Success!"; fi
88
endif
89
if BUILDDEDICATED
90
	@echo "Testing server starter script..."
91
	@cd ._$*; ./$(initdir)/@progname@ start
92
	@cd ._$*; ./$(initdir)/@progname@ status || { sleep 5; ./$(initdir)/@progname@ status; }
93
	@cd ._$*; ./$(initdir)/@progname@ restart
94
	@cd ._$*; ./$(initdir)/@progname@ status || { sleep 5; ./$(initdir)/@progname@ status; }
95
	@cd ._$*; ./$(initdir)/@progname@ stop
96
	@sleep 1
97
	@cd ._$*; ./$(initdir)/@progname@ stop || true
98
	@cd ._$*; if ./$(initdir)/@progname@ status; then exit 1; else echo "Success!"; fi
99
#   for testing the stop-on-uninstall code
100
#   @cd ._$*; ./$(initdir)/@progname@ start
101
endif
102
endif
103
104
installcheck_douninstall.inst:
105
	DESTDIR=`pwd`/._inst $(MAKE) uninstall
106
107
installcheck_uninstall.inst: installcheck_test.inst
1003 by z-man
Merging branch 0.2.8 from revision 9495 to 9501:
108
1 by luke-jr
Unify tags/branches of modules released together
109
installcheck_uninstall.%: installcheck_install.%
110
	rm -rf ._$*/${localstatedir} ._$*/.doc ._$*/.help ._$*/leak.log ._$*/memprofile*.txt ._$*/gmon.out ._$*/@logdir@
111
	$(MAKE) installcheck_douninstall.$*
112
	find ._$* -type f -exec echo leftover file \{\} >> .leftover.$* \;
113
	find ._$* -type l -exec echo leftover link \{\} >> .leftover.$* \;
114
	if test -s .leftover.$*; then cat .leftover.$*; false; else true; fi
115
	rm -f .leftover.$*
116
1003 by z-man
Merging branch 0.2.8 from revision 9495 to 9501:
117
if USE_UNINSTALL
118
installcheck_douninstall.inst2:
119
	./._inst2/$(bindir)/${uninstaller}
120
	find ._inst2 -mindepth 1 -type d -name ${progname} -exec echo leftover directory \{\} >> .leftover.inst2 \;
121
122
installcheck_douninstall.inst3:
123
	./._inst3/$(bindir)/${uninstaller}
124
	find ._inst3 -mindepth 1 -type d -name ${progname} -exec echo leftover directory \{\} >> .leftover.inst3 \;
125
1004 by z-man
Merging branch 0.2.8 from revision 9501 to 9506:
126
myinstallcheck: installcheck_uninstall.inst installcheck_uninstall.inst2
1003 by z-man
Merging branch 0.2.8 from revision 9495 to 9501:
127
else
1004 by z-man
Merging branch 0.2.8 from revision 9501 to 9506:
128
myinstallcheck: installcheck_uninstall.inst
1003 by z-man
Merging branch 0.2.8 from revision 9495 to 9501:
129
endif
1 by luke-jr
Unify tags/branches of modules released together
130
	$(predistcheckclean)
131
	@echo -e "\n---------------------------------------\nInstallation and uninstallation worked!\n---------------------------------------\n"
132
1004 by z-man
Merging branch 0.2.8 from revision 9501 to 9506:
133
installcheck: myinstallcheck
134
devcheck: beautify myinstallcheck
21 by z-man
Merging branch 0.2.8 from revision 4640 to 4667:
135
fullcheck: beautify devcheck distcheck
1 by luke-jr
Unify tags/branches of modules released together
136
406 by z-man
Merging branch 0.2.8 from revision 6778 to 6798:
137
# run all that don't require a full rebuild
138
test: installcheck
139
19 by z-man
Merging branch 0.2.8 from revision 4612 to 4640:
140
###############
141
# Fingerprint #
142
###############
143
144
# initial rule for source change tag (make it really old)
145
.changetag:
146
	touch -t 7001010101 $@
147
148
# make snapshot of SVN state, tracking relevant changes in .changetag
149
fingerprint: .changetag
747.1.4 by z-man
Merging branch 0.2.8 from revision 8719 to 8743:
150
# easy, just do svn info, that contains all the information needed. If that fails, try other scms.
151
	svn info ${top_srcdir} > $@ || svk info ${top_srcdir} > $@ || { bzr testament ${top_srcdir}; bzr info ${top_srcdir};  } > $@ || echo "unknown" > $@
407 by z-man
Merging branch 0.2.8 from revision 6798 to 6800:
152
	svn info `dirname ${top_srcdir}` >> @$ || svn info `dirname ${top_srcdir}` >> $@ || echo "unknown" >> $@
145 by z-man
Merging branch 0.3.0 from revision 4992 to 5014:
153
	diff $@ .changetag > /dev/null 2>&1 || { cp $@ .changetag; rm $(srcdir)/ChangeLog;  touch -t 198001010000 $(srcdir)/ChangeLog; }
19 by z-man
Merging branch 0.2.8 from revision 4612 to 4640:
154
155
########################
156
# tracking changes     #
157
########################
158
159
# change version on deliberate version edit
160
$(srcdir)/version: $(wildcard $(srcdir)/*_version) .changetag
1 by luke-jr
Unify tags/branches of modules released together
161
	echo "m4_define(AUTOMATIC_VERSION,["`sh $(srcdir)/batch/make/version $(srcdir)`"])" > $@
162
163
# Keep the changelog up to date as well (triggered by make dist only)
19 by z-man
Merging branch 0.2.8 from revision 4612 to 4640:
164
$(srcdir)/ChangeLog: .changetag
165
	rm -f $@
747.1.4 by z-man
Merging branch 0.2.8 from revision 8719 to 8743:
166
	@echo -e "\nGenerating ChangeLog from SVN/BZR, please be patient...\n"
957 by z-man
Merging branch 0.2.8 from revision 9322 to 9356:
167
	cd ${srcdir}; svn log 2>&1 > ChangeLog || bzr log --gnu-changelog 2>&1 > ChangeLog || echo "No official releasse: no changelog" > ChangeLog
19 by z-man
Merging branch 0.2.8 from revision 4612 to 4640:
168
	test -r $@ || touch $@
169
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
747.1.16 by Manuel Moos
Removing dead script parts.
174
	if test -d ${srcdir}/.svn || test -d ${srcdir}/.bzr; 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
477 by z-man
Merging branch 0.2.8 from revision 7078 to 7142:
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