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