diff options
author | Jim Meyering <jim@meyering.net> | 2000-03-24 05:54:46 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-03-24 05:54:46 +0000 |
commit | e0ca9372fc87a5fd07c72249e2736876b3f59a34 (patch) | |
tree | 596cd0c61f7a8bcc5f89f2a3e020c76a13fa7b40 /lib | |
parent | a8bc6aee1ca92cb042324497d4efe71d2dd13bc1 (diff) | |
download | coreutils-e0ca9372fc87a5fd07c72249e2736876b3f59a34.tar.xz |
(EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
(charset_alias): Define.
(install-exec-local): Factor out common code.
(uninstall-local): Split lines longer than 80.
(ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
(SUFFIXES): Define.
(.sed.in.sed): New rule. Don't redirect directly to $@.
(CLEANFILES): Add ref-add.sed and ref-del.sed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 66f7b61f0..8a4a14bf7 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -35,7 +35,7 @@ BUILT_SOURCES = getdate.c lstat.c stat.c MAINTAINERCLEANFILES = $(BUILT_SOURCES) DISTCLEANFILES = lstat.c stat.c -EXTRA_DIST = xstat.in config.charset +EXTRA_DIST = xstat.in config.charset ref-add.sed.in ref-del.sed.in lstat.c: xstat.in sed \ -e '/@IGNORE@/d' \ @@ -62,36 +62,35 @@ stat.c: xstat.in all-local: charset.alias ref-add.sed ref-del.sed +charset_alias = $(DESTDIR)$(libdir)/charset.alias install-exec-local: all-local $(mkinstalldirs) $(DESTDIR)$(libdir) - if test -f $(DESTDIR)$(libdir)/charset.alias; then \ - sed -f ref-add.sed < $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/charset.alias-t ; \ - else \ - sed -f ref-add.sed < charset.alias > $(DESTDIR)$(libdir)/charset.alias-t ; \ - fi - $(INSTALL_DATA) $(DESTDIR)$(libdir)/charset.alias-t $(DESTDIR)$(libdir)/charset.alias - rm -f $(DESTDIR)$(libdir)/charset.alias-t + test -f $(charset_alias) \ + && orig=$(charset_alias) \ + || orig=charset.alias; \ + sed -f ref-add.sed $$orig > $(charset_alias)-t + $(INSTALL_DATA) $(charset_alias)-t $(charset_alias) + rm -f $(charset_alias)-t uninstall-local: all-local - if test -f $(DESTDIR)$(libdir)/charset.alias; then \ - sed -f ref-del.sed < $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/charset.alias-t ; \ - if grep '^# Packages using this file: $$' $(DESTDIR)$(libdir)/charset.alias-t > /dev/null ; then \ - rm -f $(DESTDIR)$(libdir)/charset.alias ; \ + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_alias)-t; \ + if grep '^# Packages using this file: $$' $(charset_alias)-t \ + > /dev/null; then \ + rm -f $(charset_alias); \ else \ - $(INSTALL_DATA) $(DESTDIR)$(libdir)/charset.alias-t $(DESTDIR)$(libdir)/charset.alias ; \ - fi ; \ - rm -f $(DESTDIR)$(libdir)/charset.alias-t ; \ + $(INSTALL_DATA) $(charset_alias)-t $(charset_alias); \ + fi; \ + rm -f $(charset_alias)-t; \ fi charset.alias: config.charset $(SHELL) $(srcdir)/config.charset '@host@' > $@-t mv $@-t $@ -ref-add.sed: ref-add.sed.in - sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' < $(srcdir)/ref-add.sed.in > ref-add.sed - -ref-del.sed: ref-del.sed.in - sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' < $(srcdir)/ref-del.sed.in > ref-del.sed - +SUFFIXES = .sed .sed.in +.sed.in.sed: + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t + mv $@-t $@ -CLEANFILES = charset.alias +CLEANFILES = charset.alias ref-add.sed ref-del.sed |