Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   etc/Makefile: simplify build rule for conf files (http://www.linux-archive.org/archlinux-pacman-development/706404-etc-makefile-simplify-build-rule-conf-files.html)

Dave Reisner 09-22-2012 04:17 PM

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>
---
I'm actually not sure I grok the need for the tmp file here. If anyone
happens to know why this patch might be a bad idea, feel free to chime
in.

etc/Makefile.am | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/etc/Makefile.am b/etc/Makefile.am
index 58a80bd..7a1b91b 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -4,8 +4,9 @@ EXTRA_DIST = makepkg.conf.in pacman.conf.in
# Files that should be removed, but which Automake does not know.
MOSTLYCLEANFILES = $(dist_sysconf_DATA)

-#### Taken from the autoconf scripts Makefile.am ####
-edit = sed
+SED_PROCESS =
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) &&
+ $(SED)
-e 's|@sysconfdir[@]|$(sysconfdir)|g'
-e 's|@localstatedir[@]|$(localstatedir)|g'
-e 's|@prefix[@]|$(prefix)|g'
@@ -19,14 +20,10 @@ edit = sed
-e 's|@CARCH[@]|$(CARCH)|g'
-e 's|@CHOST[@]|$(CHOST)|g'
-e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g'
- -e 's|@ROOTDIR[@]|$(ROOTDIR)|g'
+ -e 's|@ROOTDIR[@]|$(ROOTDIR)|g'
+ < $< > $@

-$(dist_sysconf_DATA): Makefile
- $(AM_V_at)$(RM) $@ $@.tmp
- $(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
+%.conf: %.conf.in Makefile
+ $(SED_PROCESS)

# vim:set ts=2 sw=2 noet:
--
1.7.12.1


All times are GMT. The time now is 07:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.