Rename pmloglevel_t to alpm_loglevel_t
[pacman-ng.git] / scripts / Makefile.am
blobe34c30051cf9c7f9d22046c30de06c9b06e0e272
1 # enforce that all scripts have a --help and --version option
2 AUTOMAKE_OPTIONS = std-options
4 SUBDIRS = po
6 bin_SCRIPTS = \
7         $(OURSCRIPTS) \
8         repo-remove \
9         repo-elephant
11 OURSCRIPTS = \
12         makepkg \
13         pacman-db-upgrade \
14         pacman-key \
15         pacman-optimize \
16         pkgdelta \
17         rankmirrors \
18         repo-add
20 EXTRA_DIST = \
21         makepkg.sh.in \
22         pacman-db-upgrade.sh.in \
23         pacman-key.sh.in \
24         pacman-optimize.sh.in \
25         pkgdelta.sh.in \
26         rankmirrors.sh.in \
27         repo-add.sh.in \
28         $(LIBRARY)
30 LIBRARY = \
31         library/output_format.sh \
32         library/parse_options.sh
34 # Files that should be removed, but which Automake does not know.
35 MOSTLYCLEANFILES = $(bin_SCRIPTS)
37 if USE_GIT_VERSION
38 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
39 REAL_PACKAGE_VERSION = $(GIT_VERSION)
40 else
41 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
42 endif
44 #### Taken from the autoconf scripts Makefile.am ####
45 edit = sed \
46         -e 's|@localedir[@]|$(localedir)|g' \
47         -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
48         -e 's|@localstatedir[@]|$(localstatedir)|g' \
49         -e 's|@prefix[@]|$(prefix)|g' \
50         -e 's|@BASH_SHELL[@]|$(BASH_SHELL)|g' \
51         -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
52         -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
53         -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
54         -e 's|@BUILDSCRIPT[@]|$(BUILDSCRIPT)|g' \
55         -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
56         -e 's|@SEDINPLACE[@]|$(SEDINPLACE)|g' \
57         -e 's|@DUPATH[@]|$(DUPATH)|g' \
58         -e 's|@SCRIPTNAME[@]|$@|g' \
59         -e 's|@configure_input[@]|Generated from $@.sh.in; do not edit by hand.|g'
61 ## All the scripts depend on Makefile so that they are rebuilt when the
62 ## prefix etc. changes. Use chmod -w to prevent people from editing the
63 ## wrong file by accident.
64 # two 'test' lines- make sure we can handle both sh and py type scripts
65 # third 'test' line- make sure one of the two checks succeeded
66 $(OURSCRIPTS): Makefile
67         @echo '    ' GEN $@;
68         @rm -f $@
69         @test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
70         @chmod +x $@
71         @chmod a-w $@
73 makepkg: \
74         $(srcdir)/makepkg.sh.in \
75         $(srcdir)/library/parse_options.sh
77 pacman-db-upgrade: \
78         $(srcdir)/pacman-db-upgrade.sh.in \
79         $(srcdir)/library/output_format.sh
81 pacman-key: \
82         $(srcdir)/pacman-key.sh.in \
83         $(srcdir)/library/output_format.sh
85 pacman-optimize: \
86         $(srcdir)/pacman-optimize.sh.in \
87         $(srcdir)/library/output_format.sh
89 pkgdelta: \
90         $(srcdir)/pkgdelta.sh.in \
91         $(srcdir)/library/output_format.sh
93 rankmirrors: $(srcdir)/rankmirrors.sh.in
95 repo-add: \
96         $(srcdir)/repo-add.sh.in \
97         $(srcdir)/library/output_format.sh
99 repo-remove: $(srcdir)/repo-add.sh.in
100         rm -f repo-remove
101         $(LN_S) repo-add repo-remove
103 repo-elephant: $(srcdir)/repo-add.sh.in
104         rm -f repo-elephant
105         $(LN_S) repo-add repo-elephant
107 # vim:set ts=2 sw=2 noet: