1.PHONY: changelog
2
3# Things to do before compiling
4# before-all::
5
6# Things to do after compiling
7# after-all::
8
9# Things to do before installing
10# before-install::
11
12# Things to do after installing
13# after-install::
14
15# Things to do before uninstalling
16# before-uninstall::
17
18# Things to do after uninstalling
19# after-uninstall::
20
21# Things to do before cleaning
22# before-clean::
23
24# Things to do after cleaning
25# after-clean::
26
27# Things to do before distcleaning
28# before-distclean::
29
30# Things to do after distcleaning
31# after-distclean::
32
33# Things to do before checking
34# before-check::
35
36# Things to do after checking
37# after-check::
38
39distdir = $(APP_NAME)-$(VERSION)
40here = $(shell pwd)
41
42distfiles := $(shell find . -type f -print | grep -v -e CVS -e '\.cvsignore' -e '^\.$$' -e changelog-stamp -e '\.tar\.gz' -e '\.tar\.bz2' -e MiscFiles -e CVS -e $(distdir))
43distdirs := $(shell find . -type d -print | grep -v -e CVS -e '^\.$$' -e MiscFiles -e $(distdir))
44
45changelog: changelog-stamp
46changelog-stamp:
47	cvs2cl --stdout -b --utc -U MiscFiles/LOGNAMES > ChangeLog
48	touch $@
49
50distdir: distclean changelog
51	-rm -rf $(distdir)
52	mkdir $(distdir)
53	-chmod 777 $(distdir)
54	cd $(distdir)
55	for dir in $(distdirs); do \
56	  mkdir $(distdir)/$$dir; \
57	done
58	for file in $(distfiles); do \
59	  if test -d $(here)/$$file; then \
60	    cp -pr $(here)/$$file $(distdir)/$$file; \
61	  else \
62	    test -f $(distdir)/$$file \
63	    || ln $(here)/$$file $(distdir)/$$file 2> /dev/null \
64	    || cp -p $(here)/$$file $(distdir)/$$file || :; \
65	  fi; \
66	done
67
68mydist: distdir
69	-chmod -R a+r $(distdir)
70	tar -cho $(distdir) | gzip -9 > $(distdir).tar.gz
71	tar -cho $(distdir) | bzip2 -9 > $(distdir).tar.bz2
72	-rm -rf $(distdir)
73