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