]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - Makefile
omit fpdf libs
[SourceForge/phpwiki.git] / Makefile
1 # gnu make (also with cygwin) version
2 # TODO: get db params from config/config.ini
3 DB_ADMINUSER=root
4 DB_ADMINPASS=secret
5 DB_DB=phpwiki
6 DB_USER=wikiuser
7 DB_PASS=
8
9 DB_SQLITE_DBFILE = /tmp/phpwiki-sqlite.db
10 # ****************************************************************************
11 PHP_SRC := $(wildcard *.php ./lib/*.php ./lib/WikiDB/*.php ./lib/plugin/*.php)
12
13 all:  TAGS
14
15 TAGS:  $(PHP_SRC)
16 #       etags $(PHP_SRC)
17         if [ -f TAGS ]; then /usr/bin/mv -f TAGS TAGS~; fi
18         /usr/bin/find . . \( -type d -regex '\(^\./lib/pear\)\|\(^\./lib/WikiDB/adodb\)\|\(^\./lib/nusoap\)\|\(^\./lib/fpdf\)\|\(^\./locale/.*/LC_MESSAGES\)' \) -prune -o -name \*.php -exec etags -a '{}' \;
19
20 locale: 
21         cd locale
22         make
23
24 DB_OPTS=-u$(DB_ADMINUSER) -p$(DB_ADMINPASS)
25
26 mysql:
27         mysqladmin $(DB_OPTS) create $(DB_DB)
28         mysql $(DB_OPTS) -e "GRANT select,insert,update,delete,lock tables ON $(DB_DB).* \
29 TO $(DB_USER)@localhost IDENTIFIED BY '$(DB_PASS)';"
30         mysql $(DB_OPTS) $(DB_DB) < schemas/mysql.sql
31
32 psql:
33         su postmaster
34         createdb $(DB_DB)
35 ifeq ($(DB_PASS),"")
36         createuser -D -A -P $(DB_USER)
37 else
38         createuser -D -A $(DB_USER)
39 endif
40         psql $(DB_DB) -f schemas/psql.sql
41         logout
42
43 sqlite:
44         sqlite $(DB_SQLITE_DBFILE) < schemas/sqlite.sql