etc/Makefile: simplify build rule for conf files
This lets us define the build rule and the dependency all at once, and additionally removes the need for an intermediate temp file. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
40d6894910
commit
ded25aeb98
|
@ -4,8 +4,9 @@ EXTRA_DIST = makepkg.conf.in pacman.conf.in
|
||||||
# Files that should be removed, but which Automake does not know.
|
# Files that should be removed, but which Automake does not know.
|
||||||
MOSTLYCLEANFILES = $(dist_sysconf_DATA)
|
MOSTLYCLEANFILES = $(dist_sysconf_DATA)
|
||||||
|
|
||||||
#### Taken from the autoconf scripts Makefile.am ####
|
SED_PROCESS = \
|
||||||
edit = sed \
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
|
||||||
|
$(SED) \
|
||||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||||
-e 's|@localstatedir[@]|$(localstatedir)|g' \
|
-e 's|@localstatedir[@]|$(localstatedir)|g' \
|
||||||
-e 's|@prefix[@]|$(prefix)|g' \
|
-e 's|@prefix[@]|$(prefix)|g' \
|
||||||
|
@ -19,14 +20,10 @@ edit = sed \
|
||||||
-e 's|@CARCH[@]|$(CARCH)|g' \
|
-e 's|@CARCH[@]|$(CARCH)|g' \
|
||||||
-e 's|@CHOST[@]|$(CHOST)|g' \
|
-e 's|@CHOST[@]|$(CHOST)|g' \
|
||||||
-e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g' \
|
-e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g' \
|
||||||
-e 's|@ROOTDIR[@]|$(ROOTDIR)|g'
|
-e 's|@ROOTDIR[@]|$(ROOTDIR)|g' \
|
||||||
|
< $< > $@
|
||||||
|
|
||||||
$(dist_sysconf_DATA): Makefile
|
%.conf: %.conf.in Makefile
|
||||||
$(AM_V_at)$(RM) $@ $@.tmp
|
$(SED_PROCESS)
|
||||||
$(AM_V_GEN)$(edit) `test -f ./$@.in || echo $(srcdir)/`$@.in >$@.tmp
|
|
||||||
$(AM_V_at)mv $@.tmp $@
|
|
||||||
|
|
||||||
makepkg.conf: $(srcdir)/makepkg.conf.in
|
|
||||||
pacman.conf: $(srcdir)/pacman.conf.in
|
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 noet:
|
# vim:set ts=2 sw=2 noet:
|
||||||
|
|
Loading…
Reference in New Issue