From e7c499798b49af3bf9c5c2ad1f295a4c9e415acd Mon Sep 17 00:00:00 2001 From: Henning Geinitz Date: Thu, 5 Jan 2006 21:53:01 +0000 Subject: [PATCH] Regenerate .conf files only if .conf.in were changed. --- ChangeLog | 1 + backend/Makefile.in | 30 +++++++++++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc2c801ce..08e4b7aa4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ by the appropriate directories. This is especially useful for firmware locations. For the firmware paths for the artec_eplus48u, gt68xx, and snapscan backends variables were used. Bug #302590. + Regenerate .conf files only if .conf.in were changed. * backend/.cvsignore: Added *.conf. * README.linux: Mentioned udev. * doc/backend-writing.txt: New chapters about the build system and diff --git a/backend/Makefile.in b/backend/Makefile.in index fd0f0e835..237487c49 100644 --- a/backend/Makefile.in +++ b/backend/Makefile.in @@ -170,8 +170,6 @@ DISTFILES = abaton.c abaton.conf.in abaton.h agfafocus.c agfafocus.conf.in \ sm3840.conf.in sm3840.c sm3840_lib.c sm3840_params.h sm3840_scan.c sm3840.h \ sm3840_lib.h - - .PHONY: all clean depend dist distclean install uninstall libsane-%.la: %.lo %-s.lo $(EXTRA) $(LIBOBJS) @@ -286,21 +284,19 @@ libsane.la: dll.lo dll-s.lo $(EXTRA) $(addsuffix .lo,$(DLL_PRELOAD)) $(LIBOBJS) $(addsuffix .lo,$(DLL_PRELOAD_EXTRAS)) @LIBTOOL_LINK_EXTRA@ \ -rpath $(libdir) -version-info $(V_MAJOR):$(V_REV):$(V_MINOR) -becfg: - @for conf in $(CONFIGS) ; do \ - if test ! -f $${conf}.in ; \ - then echo "Ignoring $${conf}" ;\ - continue; \ - fi ;\ - sed -e 's|@DATADIR@|$(datadir)|g' \ - -e 's|@CONFIGDIR@|$(configdir)|g' \ - -e 's|@DOCDIR@|$(docdir)|g' \ - -e 's|@LIBDIR@|$(libdir)/sane|g' \ - -e 's|@BINDIR@|$(bindir)|g' \ - -e 's|@SBINDIR@|$(sbindir)|g' \ - -e 's|@PACKAGEVERSION@|$(package_version)|g' $${conf}.in >$${conf} ;\ - echo Generating $${conf}... ;\ - done +# Generate .conf files for all existing .conf.in files +becfg: $(patsubst %.conf.in,%.conf,$(wildcard *.conf.in)) +%.conf: %.conf.in + @echo Generating $@ from $^ + @sed -e 's|@DATADIR@|$(datadir)|g' \ + -e 's|@CONFIGDIR@|$(configdir)|g' \ + -e 's|@DOCDIR@|$(docdir)|g' \ + -e 's|@LIBDIR@|$(libdir)/sane|g' \ + -e 's|@BINDIR@|$(bindir)|g' \ + -e 's|@SBINDIR@|$(sbindir)|g' \ + -e 's|@PACKAGEVERSION@|$(package_version)|g' $? > $@ + + # additional dependencies