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

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
# include $(top_srcdir)/Makefile.paths

# script locations
armascriptdir=$(scriptdir)

# Handle which scripts to build
basercScripts=rcd_config rcd_startstop

# include autogenerated makefile that generates 
# the universal variable replacement sed script
../universal_variable_values_makefile:
	cd ..; ./config.status universal_variables
@silent_inc@ ../universal_variable_values_makefile

if BUILDREGULAR
regScripts=
regrcScripts=
regrcScriptLN=
endif

if BUILDMASTER
masterScripts=masterstarter
masrcScripts=rcd_master
endif

if BUILDDEDICATED
dedScripts=serverstarter
dedrcScripts=rcd_server
endif

scriptsToBuild=$(basercScripts) $(masterScripts) $(dedScripts) $(regScripts) sysinstall relocate
rcScripts=$(regrcScripts) $(masrcScripts) $(dedrcScripts)

armascript_SCRIPTS=$(scriptsToBuild) $(rcScripts)
#armainitscript_SCRIPTS=

# What goes in a distribution

EXTRA_DIST=\
	install.in\
	masterstarter.in\
	rcd_config.in\
	rcd_master.in\
	rcd_server.in\
	rcd_startstop.in\
	serverstarter.in\
	sysinstall.in\
	starter.in\
	stat.in\
    make/uninstall\
	make/releasetag\
	make/sortresources.py\
	make/sortresources\
	make/regenerate_fingerprint

# The command for building scripts
buildscript = sed -f ${top_builddir}/universal_variable_values_sed\
        -e 's,@version\@,$(VERSION),g' \
        -e 's,@executable_suffix\@,$(executable_suffix),g' \
	    -e "s,/bin/bash,`which bash`,g"\
		-e 's,@LN_S\@,$(LN_S),g'\
        -e 's,@progname\@,@progname@,g' \
		-e 's,@prognamebase\@,@prognamebase@,g' \
		-e 's,@progtitle\@,@progtitle@,g' \
		-e 's,@enable_useradd\@,@enable_useradd@,g' \
		-e 's,@enable_etc\@,@enable_etc@,g' \
		-e 's,@enable_initscripts\@,@enable_initscripts@,g' \
		-e 's,@enable_desktop\@,@enable_desktop@,g' \
		-e 's,@enable_restoreold\@,@enable_restoreold@,g'\
		-e 's,@progdir_suffix\@,@progdir_suffix@,g'

%: %.in Makefile ${top_builddir}/universal_variable_values_sed
#	just replace the @foo@s with the variable values
	$(buildscript) < $< > $@
	chmod 755 $@

sysinstall: sysinstall.in Makefile ${top_builddir}/universal_variable_values_sed relocate
#	do almost the same as for regular scripts...
	$(buildscript) < $< > $@.proto
#	only replace the occurence of RELOCATECOMMANDS with the
#	contents of the relocation script. We need to inject it
#	rather than just call it because the relocate script relies on
#	a shell function being available.
#   Some sed's don't have T, so we have to make it a little more complex.
	sed -e "s,RELOCATECOMMANDS,\\\," -e "t rel" -e "b" -e ": rel" -e "r relocate" < $@.proto > $@
	rm $@.proto
	chmod 755 $@

clean-local:
	rm -f $(armascript_SCRIPTS)