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