##
## Makefile -- daCode http://www.dacode.org/
## $Id: Makefile,v 1.22 2001/07/22 22:07:44 penso Exp $
## Denis Barbier <barbier@linuxfr.org>
## This program is free software, released under the GNU GPL v2
##

VERSION = 1.2.0

##
##   There is no default target
##

all:
	@:

##
##   Standard utilities
##

FIND = find     # on some systems, GNU find is called gfind
GZIP = gzip
TAR  = tar

php php3 php4 reconf:
	@echo This rule has been superseded by scripts/dacodeconfig.
	@echo Run \`perldoc scripts/dacodeconfig\' for documentation

##
##  Check SQL queries for tainted variables
##
sqlcheck:
	@./scripts/sqlcheck.pl --files --lines --tables --notainted --sqlcommand

##
##  Create tarball
##

TARCUST = tarcust     # free alternative to tardy
USER  = daCode
GROUP = daCode

NAME  = daCode

EXCLUDE_FILES = .*CVS.* .*.cvsignore .scvsrc \
   $(NAME)-.* \
   src/htdocs/cache.* \
   .dacode.* build.* \
   .*config.site .*config.php.*

tar:
	#  Sort files alphatebically according to C locale
	export LC_ALL=C; \
   x=`echo $(EXCLUDE_FILES) |\
      sed -e 's#/#\\\\/#g' -e 's/[ 	]\{1,\}/ -x /g'`; \
   $(TAR) cf - * |\
   $(TARCUST) -x $$x -u $(USER) -U 0 -g $(GROUP) -G 0 -p $(NAME)-$(VERSION) |\
   $(GZIP) -9 > $(NAME)-$(VERSION).tar.gz

update-version:
	f=src/htdocs/dacode.php3; \
   sed -e "s/\\(^[ 	]*\$$config->version[ 	]*=\\).*$$/\\1 \"$(VERSION)\";/" $$f > $$f.tmp && mv $$f.tmp $$f

##EOF##
