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