Commit | Line | Data |
---|---|---|
f22ab4f4 | 1 | VERSION=0.24 |
41b9d8ec TC |
2 | DISTNAME=bse-$(VERSION) |
3 | DISTBUILD=$(DISTNAME) | |
4 | DISTTAR=../$(DISTNAME).tar | |
5 | DISTTGZ=$(DISTTAR).gz | |
68991946 | 6 | WEBBASE=/home/tony/www/bse |
6271b583 | 7 | PERL=$(shell perl -It -MBSE::Test -e 'print BSE::Test::test_perl()') |
859833f2 | 8 | PERLBIN=$(shell $(PERL) -MConfig -e 'print $$Config{installbin}') |
41b9d8ec | 9 | |
8bf647a0 TC |
10 | BSEMODULES=site/cgi-bin/modules/BSE/Modules.pm |
11 | ||
6271b583 TC |
12 | NOOP=echo Nothing |
13 | ||
473afcfa TC |
14 | HTMLDEPS=$(shell $(PERL) -lane 'print $$F[0] if $$F[0] =~ /\.(pm|pl|pod)$$/' MANIFEST) |
15 | ||
ed1ff43e | 16 | MODULES=$(shell grep cgi-bin/.*\.pm MANIFEST | sed -e '/^\#/d' -e 's/[ \t].*//' -e '/^site\/cgi-bin\/modules\/BSE\/\(Modules\|Version\)\.pm/d' ) |
6271b583 TC |
17 | VERSIONDEPS=$(shell $(PERL) site/util/bse_versiondeps.pl MANIFEST) |
18 | ||
19 | POD2TEXT=$(PERLBIN)/pod2text | |
20 | POD2HTML=$(PERLBIN)/pod2html | |
75b07edf | 21 | |
5bbf7309 TC |
22 | UTILDIR=$(shell $(PERL) -Ilib -MBSE::Install=util_dir -e 'print util_dir') |
23 | DATADIR=$(shell $(PERL) -Ilib -MBSE::Install=data_dir -e 'print data_dir') | |
24 | ||
859833f2 TC |
25 | .PHONY: help dist cleantree archive distdir clean docs otherdocs dbinfo |
26 | .PHONY: version modversion testinst test testup checkver regen_known_errors | |
27 | .PHONY: manicheck filecheck manifect htmldocs | |
28 | ||
41b9d8ec | 29 | help: |
8b0b2f34 | 30 | @echo make dist - build the tar.gz file and copy to distribution directory |
12bcb7ac | 31 | @echo make 'archive - build the tar.gz (in the parent directory)' |
41b9d8ec | 32 | @echo make clean - delete generated files |
6e73144d TC |
33 | @echo make distdir - build distribution directory |
34 | @echo make docs - build documentation | |
a47e539f | 35 | @echo make testup - upgrade an installation |
41b9d8ec TC |
36 | |
37 | # this target needs to be modified so that the output directory includes | |
38 | # the release number | |
957a90ca | 39 | dist: cleantree $(DISTTGZ) |
227b99dc TC |
40 | cp $(DISTTGZ) $(WEBBASE)/dists/ |
41 | cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html | |
42 | cp site/docs/*.html $(WEBBASE)/docs | |
0f35f2b7 | 43 | git tag -m "$(VERSION) release" r$(VERSION) |
957a90ca TC |
44 | |
45 | # make sure everything is committed | |
46 | cleantree: | |
85802bd5 TC |
47 | if grep -q 'perl.*-d:ptkdb' site/cgi-bin/*.pl site/cgi-bin/admin/*.pl ; \ |
48 | then echo '***' The debugger is still enabled ; \ | |
49 | exit 1; \ | |
50 | fi | |
0f35f2b7 | 51 | test -z "`git status -s`" || ( echo "Uncommitted files in the tree"; exit 1 ) |
41b9d8ec | 52 | |
8b0b2f34 TC |
53 | archive: $(DISTTGZ) |
54 | ||
41b9d8ec TC |
55 | $(DISTTGZ): distdir |
56 | if [ -e $(DISTTGZ) ] ; \ | |
57 | then echo $(DISTTGZ) already exists ; \ | |
58 | exit 1 ; \ | |
59 | fi | |
60 | tar cf $(DISTTAR) $(DISTBUILD) | |
6271b583 | 61 | -$(PERL) -MExtUtils::Command -e rm_rf $(DISTBUILD) |
41b9d8ec TC |
62 | gzip $(DISTTAR) |
63 | ||
64 | # tar czf $(DISTFILE) -C .. bse --exclude '*~' --exclude '*,v' --exclude 'pod2html-*cache' | |
65 | ||
e9c9a2be TC |
66 | # recent ExtUtils::Manifest don't copy the executable bit, fix that here |
67 | ||
8bf647a0 | 68 | distdir: docs dbinfo version |
6271b583 TC |
69 | -$(PERL) -MExtUtils::Command -e rm_rf $(DISTBUILD) |
70 | $(PERL) -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')" | |
71 | $(PERL) site/util/make_versions.pl $(DISTBUILD)/$(BSEMODULES) | |
6e73144d TC |
72 | mkdir $(DISTBUILD)/site/htdocs/shop |
73 | find $(DISTBUILD) -type f | xargs chmod u+w | |
e9c9a2be | 74 | for i in `cat MANIFEST` ; do if [ -x $$i ] ; then chmod a+x $(DISTBUILD)/$$i ; fi ; done |
41b9d8ec TC |
75 | |
76 | clean: | |
6271b583 | 77 | $(NOOP) |
41b9d8ec | 78 | |
6e73144d | 79 | docs: INSTALL.txt INSTALL.html otherdocs |
41b9d8ec | 80 | |
6e73144d | 81 | INSTALL.txt: INSTALL.pod |
859833f2 TC |
82 | $(POD2TEXT) <INSTALL.pod >INSTALL.tmp |
83 | mv INSTALL.tmp INSTALL.txt | |
41b9d8ec TC |
84 | |
85 | INSTALL.html: INSTALL.pod | |
859833f2 TC |
86 | $(POD2HTML) --infile=INSTALL.pod --outfile=INSTALL.htmp |
87 | mv INSTALL.htmp INSTALL.html | |
0f35f2b7 | 88 | -rm pod2html-dircache pod2html-itemcache pod2htmd.tmp pod2htmi.tmp |
41b9d8ec TC |
89 | |
90 | otherdocs: | |
6271b583 | 91 | cd site/docs ; make all PERL=$(PERL) |
6e73144d | 92 | |
b19047a6 TC |
93 | dbinfo: site/util/mysql.str |
94 | ||
bee8ef2b | 95 | site/util/mysql.str: schema/bse.sql schema/mysql_build.pl |
6271b583 | 96 | $(PERL) schema/mysql_build.pl >site/util/mysql.str |
b19047a6 | 97 | |
d2730773 TC |
98 | version: site/cgi-bin/modules/BSE/Version.pm |
99 | ||
ed1ff43e | 100 | site/cgi-bin/modules/BSE/Version.pm: $(VERSIONDEPS) |
6271b583 | 101 | $(PERL) site/util/bse_mkgitversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm |
7057fbc0 | 102 | |
8bf647a0 | 103 | modversion: $(BSEMODULES) |
75b07edf | 104 | |
8bf647a0 | 105 | $(BSEMODULES): $(MODULES) site/util/make_versions.pl |
6271b583 | 106 | $(PERL) site/util/make_versions.pl $(BSEMODULES) |
75b07edf | 107 | |
6e73144d TC |
108 | # this is very rough |
109 | testinst: distdir | |
6271b583 TC |
110 | $(PERL) localinst.perl $(DISTBUILD) |
111 | $(PERL) -MExtUtils::Command -e rm_rf $(DISTBUILD) | |
5bbf7309 | 112 | cd $(UTILDIR) ; $(PERL) loaddata.pl $(DATADIR)/db |
34bc5961 | 113 | |
cb7fd78d | 114 | testup: checkver distdir |
6271b583 TC |
115 | $(PERL) localinst.perl $(DISTBUILD) leavedb |
116 | $(PERL) -MExtUtils::Command -e rm_rf $(DISTBUILD) | |
5bbf7309 | 117 | cd $(UTILDIR) ; $(PERL) upgrade_mysql.pl -b ; $(PERL) loaddata.pl $(DATADIR)/db |
09a131dd | 118 | |
cb7fd78d | 119 | checkver: |
0f35f2b7 | 120 | if [ -d .git ] ; then perl site/util/check_versions.pl ; fi |
cb7fd78d | 121 | |
58f0ca94 | 122 | TEST_FILES=t/*.t t/*/*.t |
e4a9e7c6 | 123 | TEST_VERBOSE=0 |
87b53bfa TC |
124 | |
125 | test: testup | |
6271b583 | 126 | $(PERL) '-MTest::Harness=runtests,$$verbose' -Isite/cgi-bin/modules -It -e '$$verbose=$(TEST_VERBOSE); runtests @ARGV' $(TEST_FILES) |
35c0719f | 127 | |
983772f8 | 128 | regen_known_errors: |
71bafa2a | 129 | $(PERL) t/900-kwalitee/040-podcheck.t -r |
983772f8 | 130 | |
35c0719f | 131 | manicheck: |
6271b583 | 132 | $(PERL) -MExtUtils::Manifest=manicheck -e 'manicheck()' |
35c0719f TC |
133 | |
134 | filecheck: | |
6271b583 | 135 | $(PERL) -MExtUtils::Manifest=filecheck -e 'filecheck()' |
91238c38 TC |
136 | |
137 | manifest: | |
6271b583 | 138 | $(PERL) -MExtUtils::Manifest=mkmanifest -e mkmanifest |
473afcfa TC |
139 | |
140 | htmldocs: $(HTMLDEPS) | |
141 | if [ -z "$(HTMLDOCDIR)" ] ; then \ | |
142 | echo Supply HTMLDOCDIR ; exit 1 ; \ | |
143 | fi | |
144 | [ -d "$(HTMLDOCDIR)" ] || mkdir -p "$(HTMLDOCDIR)" | |
145 | $(PERL) makehtmldocs.pl "$(HTMLDOCDIR)" |