summaryrefslogtreecommitdiff
path: root/scripts/Makefile.am
blob: 1d711b84077ef1cacb91b5ac59587c3f59d9dc1a (plain)
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
# enforce that all scripts have a --help and --version option
AUTOMAKE_OPTIONS = std-options

bin_SCRIPTS = \
	gensync \
	makepkg \
	makeworld \
	pacman-optimize \
	rankmirrors \
	repo-add \
	repo-remove \
	updatesync

if INCLUDE_ABS
bin_SCRIPTS += abs
endif

EXTRA_DIST = \
	abs.in \
	gensync.in \
	makepkg.in \
	makeworld.in \
	pacman-optimize.in \
	rankmirrors.in \
	repo-add.in \
	repo-remove.in \
	updatesync.in

# Files that should be removed, but which Automake does not know.
MOSTLYCLEANFILES = $(bin_SCRIPTS) *.tmp

#### Taken from the autoconf scripts Makefile.am ####
edit = sed \
	-e 's|@localedir[@]|$(localedir)|g' \
	-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
	-e 's|@localstatedir[@]|$(localstatedir)|g' \
	-e 's|@prefix[@]|$(prefix)|g' \
	-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
    -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
	-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'

## All the scripts depend on Makefile so that they are rebuilt when the
## prefix etc. changes. Use chmod -w to prevent people from editing the
## wrong file by accident.
$(bin_SCRIPTS): Makefile
	rm -f $@ $@.tmp
	$(edit) `test -f ./$@.in || echo $(srcdir)/`$@.in >$@.tmp
	chmod +x $@.tmp
	chmod a-w $@.tmp
	mv $@.tmp $@

abs: $(srcdir)/abs.in
gensync: $(srcdir)/gensync.in
makepkg: $(srcdir)/makepkg.in
makeworld: $(srcdir)/makeworld.in
pacman-optimize: $(srcdir)/pacman-optimize.in
rankmirrors: $(srcdir)/rankmirrors.in
repo-add: $(srcdir)/repo-add.in
repo-remove: $(srcdir)/repo-remove.in
re-pacman: $(srcdir)/re-pacman.in
updatesync: $(srcdir)/updatesync.in