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