summaryrefslogtreecommitdiff
path: root/dviware/mdvi/config/dist.mk
blob: a8758c5753d68d2154d3d50997b2b5ce7b81571b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

.PHONY: distdir
distdir:
	@echo "Distributing into $(distdir)"
	@rm -rf $(distdir)
	@mkdir $(distdir)
	@list="$(DISTFILES)"; for i in $$list; do \
	  if test -d $(srcdir)/$$i; then \
	    echo "cp -pr $(srcdir)/$$i $(distdir)/$$i"; \
	    cp -pr $(srcdir)/$$i $(distdir)/$$i; \
	  else \
	    echo "cp -p $(srcdir)/$$i $(distdir)/$$i"; \
	    cp -p $(srcdir)/$$i $(distdir)/$$i; \
	  fi; \
	done
	@list="$(DISTDIRS)"; for i in $$list; do \
	  if test -n "$$i" -a "$$i" != .; then \
	    test -d $(distdir)/$$i || mkdir $(distdir)/$$i || exit 1; \
	    $(MAKE) -C $$i $(DISTMAKEFLAGS) distdir=../$(distdir)/$$i distdir; \
	  fi; \
	done
	@list="$(NODISTFILES)"; for i in $$list; do \
	  echo "rm -f $(distdir)/$$i"; \
	  rm -f $(distdir)/$$i; \
	done

$(distdir)/MD5SUMS:
	@echo "Computing MD5 sums..."
	-@if test -x "$(MD5SUM)"; then \
	  (cd $(distdir); find . -type f -exec $(MD5SUM) {} \; > /tmp/MD5SUM$$$$); \
	  if test -s /tmp/MD5SUM$$$$; then \
	    mv -f /tmp/MD5SUM$$$$ $(distdir)/MD5SUMS; \
	  else \
	    rm -f /tmp/MD5SUM$$$$; \
	  fi; \
	fi