From 886e576b94e378dc77beccb8dcf7d7a5c76a77c2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 14 Nov 1995 23:25:13 +0000 Subject: [PATCH] (dist): Don't link or copy file if it already exists. --- dist-subd-top.am | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dist-subd-top.am b/dist-subd-top.am index b5c61d74..fbd19776 100644 --- a/dist-subd-top.am +++ b/dist-subd-top.am @@ -2,10 +2,14 @@ distdir = $(PACKAGE)-$(VERSION) dist: $(DIST_FILES) $(DIST_DIRS) rm -rf $(distdir) mkdir $(distdir) - @for file in $(DIST_FILES); do \ - echo linking $$file; \ - ln $(srcdir)/$$file $(distdir)/$$file || \ - { echo copying $$file instead; cp -p $(srcdir)/$$file $(distdir)/$$file;}; \ + @for file in $(DIST_FILES); do \ + test -f $$file || { \ + echo linking $$file; \ + ln $(srcdir)/$$file $(distdir)/$$file; \ + } || { \ + echo copying $$file instead; \ + cp -p $(srcdir)/$$file $(distdir)/$$file; \ + }; \ done for subdir in $(SUBDIRS); do \ mkdir $(distdir)/$$subdir || exit 1; \ -- 2.43.5