cli: $(SAPI_CLI_PATH)

$(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS)
	$(BUILD_CLI)

install-cli: $(SAPI_CLI_PATH)
	@echo "Installing PHP CLI binary:        $(INSTALL_ROOT)$(bindir)/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
	@$(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
	@echo "Installing PHP CLI man page:      $(INSTALL_ROOT)$(mandir)/man1/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
	@$(INSTALL_DATA) sapi/cli/php.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php$(program_suffix).1

cgi: $(SAPI_CGI_PATH)

$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CGI_OBJS)
	$(BUILD_CGI)

install-cgi: $(SAPI_CGI_PATH)
	@echo "Installing PHP CGI binary:        $(INSTALL_ROOT)$(bindir)/"
	@$(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)


ext/fileinfo/libmagic/apprentice.lo: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/fileinfo/data_file.c
phpincludedir=$(prefix)/include/php

PDO_HEADER_FILES= \
	php_pdo.h \
	php_pdo_driver.h


/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/pdo/pdo_sql_parser.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/pdo/pdo_sql_parser.re
	(cd $(top_srcdir); $(RE2C) -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re)

install-pdo-headers:
	@echo "Installing PDO headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo
	@for f in $(PDO_HEADER_FILES); do \
		if test -f "$(top_srcdir)/$$f"; then \
			$(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
		elif test -f "$(top_builddir)/$$f"; then \
			$(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
		elif test -f "$(top_srcdir)/ext/pdo/$$f"; then \
			$(INSTALL_DATA) $(top_srcdir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
		elif test -f "$(top_builddir)/ext/pdo/$$f"; then \
			$(INSTALL_DATA) $(top_builddir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
		else \
			echo "hmmm"; \
		fi \
	done;

# mini hack
install: $(all_targets) $(install_targets) install-pdo-headers

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar_path_check.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar_path_check.re
	@(cd $(top_srcdir); $(RE2C) -b -o ext/phar/phar_path_check.c ext/phar/phar_path_check.re)

pharcmd: ext/phar/phar.php ext/phar/phar.phar

PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'
PHP_PHARCMD_EXECUTABLE = ` \
	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
		if test "x$(PHP_MODULES)" != "x"; then \
		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
		for i in bz2 zlib phar; do \
			if test -f "$(top_builddir)/modules/$$i.la"; then \
				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
			fi; \
		done; \
		fi; \
	else \
		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
	fi;`
PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`

ext/phar/phar/phar.inc: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/phar.inc
	-@test -d ext/phar/phar || mkdir ext/phar/phar
	-@test -f ext/phar/phar/phar.inc || cp /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/phar.inc ext/phar/phar/phar.inc

ext/phar/phar.php: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/build_precommand.php /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/*.inc /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/*.php $(SAPI_CLI_PATH)
	-@echo "Generating phar.php"
	@$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/build_precommand.php > ext/phar/phar.php

ext/phar/phar.phar: ext/phar/phar.php ext/phar/phar/phar.inc /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/*.inc /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/*.php $(SAPI_CLI_PATH)
	-@echo "Generating phar.phar"
	-@rm -f ext/phar/phar.phar
	-@rm -f /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar.phar
	@$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) ext/phar/phar.php pack -f ext/phar/phar.phar -a pharcommand -c auto -x \\.svn -p 0 -s /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/phar.php -h sha1 -b "$(PHP_PHARCMD_BANG)"  /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/phar/phar/
	-@chmod +x ext/phar/phar.phar

install-pharcmd: pharcmd
	-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
	$(INSTALL) ext/phar/phar.phar $(INSTALL_ROOT)$(bindir)
	-@rm -f $(INSTALL_ROOT)$(bindir)/phar
	$(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/standard/var_unserializer.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/standard/var_unserializer.re
	@(cd $(top_srcdir); $(RE2C) -b -o ext/standard/var_unserializer.c ext/standard/var_unserializer.re)

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/standard/url_scanner_ex.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/ext/standard/url_scanner_ex.re
	@(cd $(top_srcdir); $(RE2C) -b -o ext/standard/url_scanner_ex.c	ext/standard/url_scanner_ex.re)

ext/standard/info.lo: ext/standard/../../main/build-defs.h

ext/standard/basic_functions.lo: $(top_srcdir)/Zend/zend_language_parser.h
$(top_srcdir)/Zend/zend_language_parser.c:
$(top_srcdir)/Zend/zend_language_scanner.c:
ext/tokenizer/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c $(top_srcdir)/Zend/zend_language_scanner.c
# -*- makefile -*-

peardir=$(PEAR_INSTALLDIR)

# Skip all php.ini files altogether
PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0

WGET = `which wget 2>/dev/null`
FETCH = `which fetch 2>/dev/null`
PEAR_PREFIX = -dp a${program_prefix}
PEAR_SUFFIX = -ds a$(program_suffix)

install-pear-installer: $(SAPI_CLI_PATH)
	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}

install-pear:
	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
	@if test ! -f pear/install-pear-nozlib.phar; then \
		if test -f /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/pear/install-pear-nozlib.phar; then \
			cp /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/pear/install-pear-nozlib.phar pear/install-pear-nozlib.phar; \
		else \
			if test ! -z "$(WGET)" && test -x "$(WGET)"; then \
				"$(WGET)" http://pear.php.net/install-pear-nozlib.phar -nd -P pear/; \
			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
				"$(FETCH)" -o pear/ http://pear.php.net/install-pear-nozlib.phar; \
			else \
				$(top_builddir)/sapi/cli/php -n /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/pear/fetch.php http://pear.php.net/install-pear-nozlib.phar pear/install-pear-nozlib.phar; \
			fi \
		fi \
	fi
	@if test -f pear/install-pear-nozlib.phar && $(mkinstalldirs) $(INSTALL_ROOT)$(peardir); then \
		$(MAKE) -s install-pear-installer; \
	else \
		cat /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/pear/install-pear.txt; \
	fi


#
# Build environment install
#

phpincludedir = $(includedir)/php
phpbuilddir = $(libdir)/build

BUILD_FILES = \
	scripts/phpize.m4 \
	build/mkdep.awk \
	build/scan_makefile_in.awk \
	build/libtool.m4 \
	Makefile.global \
	acinclude.m4 \
	ltmain.sh \
	run-tests.php

BUILD_FILES_EXEC = \
	build/shtool \
	config.guess \
	config.sub

bin_SCRIPTS = phpize php-config
man_PAGES = phpize php-config

install-build:
	@echo "Installing build environment:     $(INSTALL_ROOT)$(phpbuilddir)/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(phpbuilddir) $(INSTALL_ROOT)$(bindir) && \
	(cd $(top_srcdir) && \
	$(INSTALL) $(BUILD_FILES_EXEC) $(INSTALL_ROOT)$(phpbuilddir) && \
	$(INSTALL_DATA) $(BUILD_FILES) $(INSTALL_ROOT)$(phpbuilddir))

install-programs: scripts/phpize scripts/php-config
	@echo "Installing helper programs:       $(INSTALL_ROOT)$(bindir)/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
	@for prog in $(bin_SCRIPTS); do \
		echo "  program: $(program_prefix)$${prog}$(program_suffix)"; \
		$(INSTALL) -m 755 scripts/$${prog} $(INSTALL_ROOT)$(bindir)/$(program_prefix)$${prog}$(program_suffix); \
	done
	@echo "Installing man pages:             $(INSTALL_ROOT)$(mandir)/man1/"
	@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
	@for page in $(man_PAGES); do \
		echo "  page: $(program_prefix)$${page}$(program_suffix).1"; \
		$(INSTALL_DATA) scripts/man1/$${page}.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)$${page}$(program_suffix).1; \
	done
	
scripts/phpize: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/scripts/phpize.in $(top_builddir)/config.status
	(CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)

scripts/php-config: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/scripts/php-config.in $(top_builddir)/config.status
	(CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)

#
# Zend
#

Zend/zend_language_scanner.lo: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.h
Zend/zend_ini_scanner.lo: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.h

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_scanner.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_scanner.l
	@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.h: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.c
/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.y
	@$(YACC) -p zend -v -d /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.y -o $@

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.h: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.c
/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.y
	@$(YACC) -p ini_ -v -d /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_parser.y -o $@

/root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_scanner.c: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_ini_scanner.l
	@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)

Zend/zend_indent.lo Zend/zend_highlight.lo Zend/zend_compile.lo: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_language_parser.h
Zend/zend_execute.lo: /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_vm_execute.h /root/mountpoint-genprog/genprog-many-bugs/php-bug-2012-03-12-438a30f1e7-7337a901b7/php/Zend/zend_vm_opcodes.h
