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