Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / src / cairo / Makefile
blob803f842fd8e567615c7c84dad0f0d255662a089a
1 srcdir = /home/akshat/php-ext/cairo/phpCairo/src/cairo
2 builddir = /home/akshat/php-ext/cairo/phpCairo/src/cairo
3 top_srcdir = /home/akshat/php-ext/cairo/phpCairo/src/cairo
4 top_builddir = /home/akshat/php-ext/cairo/phpCairo/src/cairo
5 EGREP = /bin/grep -E
6 SED = /bin/sed
7 CONFIGURE_COMMAND = './configure'
8 CONFIGURE_OPTIONS =
9 SHLIB_SUFFIX_NAME = so
10 SHLIB_DL_SUFFIX_NAME = so
11 RE2C = re2c
12 AWK = gawk
13 CAIRO_SHARED_LIBADD =
14 shared_objects_cairo = cairo.lo
15 PHP_PECL_EXTENSION = cairo
16 PHP_MODULES = $(phplibdir)/cairo.la
17 all_targets = $(PHP_MODULES)
18 install_targets = install-modules install-headers
19 prefix = /usr/lib/php5
20 exec_prefix = $(prefix)
21 libdir = ${exec_prefix}/lib
22 prefix = /usr/lib/php5
23 phplibdir = /home/akshat/php-ext/cairo/phpCairo/src/cairo/modules
24 phpincludedir = /usr/lib/php5/include/php
25 CC = gcc
26 CFLAGS = -g -O2 -I/usr/include/cairo
27 CFLAGS_CLEAN = $(CFLAGS)
28 CPP = gcc -E
29 CPPFLAGS = -DHAVE_CONFIG_H
30 CXX =
31 CXXFLAGS =
32 CXXFLAGS_CLEAN = $(CXXFLAGS)
33 EXTENSION_DIR = /usr/lib/php5/lib/php/extensions/debug-non-zts-20060613
34 PHP_EXECUTABLE = /usr/lib/php5/bin/php
35 EXTRA_LDFLAGS =
36 EXTRA_LIBS =
37 INCLUDES = -I/usr/lib/php5/include/php -I/usr/lib/php5/include/php/main -I/usr/lib/php5/include/php/TSRM -I/usr/lib/php5/include/php/Zend -I/usr/lib/php5/include/php/ext -I/usr/lib/php5/include/php/ext/date/lib
38 LFLAGS =
39 LDFLAGS = -lcairo
40 SHARED_LIBTOOL =
41 LIBTOOL = $(SHELL) $(top_builddir)/libtool
42 SHELL = /bin/sh
43 INSTALL_HEADERS =
44 mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
45 INSTALL = $(top_srcdir)/build/shtool install -c
46 INSTALL_DATA = $(INSTALL) -m 644
48 DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
49 COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
51 all: $(all_targets)
52 @echo
53 @echo "Build complete."
54 @echo "Don't forget to run 'make test'."
55 @echo
57 build-modules: $(PHP_MODULES)
59 libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
60 $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
61 -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
63 libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
64 $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
66 install: $(all_targets) $(install_targets)
68 install-sapi: $(OVERALL_TARGET)
69 @echo "Installing PHP SAPI module: $(PHP_SAPI)"
70 -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
71 -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
72 for i in 0.0.0 0.0 0; do \
73 if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
74 $(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
75 break; \
76 fi; \
77 done; \
79 @$(INSTALL_IT)
81 install-modules: build-modules
82 @test -d modules && \
83 $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
84 @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/"
85 @rm -f modules/*.la >/dev/null 2>&1
86 @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
88 install-headers:
89 -@if test "$(INSTALL_HEADERS)"; then \
90 for i in `echo $(INSTALL_HEADERS)`; do \
91 i=`$(top_srcdir)/build/shtool path -d $$i`; \
92 paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
93 done; \
94 $(mkinstalldirs) $$paths && \
95 echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
96 for i in `echo $(INSTALL_HEADERS)`; do \
97 if test "$(PHP_PECL_EXTENSION)"; then \
98 src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
99 else \
100 src=$$i; \
101 fi; \
102 if test -f "$(top_srcdir)/$$src"; then \
103 $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
104 elif test -f "$(top_builddir)/$$src"; then \
105 $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
106 else \
107 (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \
108 cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
109 fi \
110 done; \
113 PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'
114 PHP_TEST_SHARED_EXTENSIONS = ` \
115 if test "x$(PHP_MODULES)" != "x"; then \
116 for i in $(PHP_MODULES)""; do \
117 . $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
118 done; \
121 test: all
122 -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
123 TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
124 TEST_PHP_SRCDIR=$(top_srcdir) \
125 CC="$(CC)" \
126 $(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -U -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
127 elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
128 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
129 if test "$$INI_FILE"; then \
130 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
131 else \
132 echo > $(top_builddir)/tmp-php.ini; \
133 fi; \
134 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
135 TEST_PHP_SRCDIR=$(top_srcdir) \
136 CC="$(CC)" \
137 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -U -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
138 else \
139 echo "ERROR: Cannot run tests without CLI sapi."; \
142 utest: all
143 -@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
144 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
145 if test "$$INI_FILE"; then \
146 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
147 else \
148 echo > $(top_builddir)/tmp-php.ini; \
149 fi; \
150 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
151 TEST_PHP_SRCDIR=$(top_srcdir) \
152 CC="$(CC)" \
153 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -u -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
154 else \
155 echo "ERROR: Cannot run tests without CLI sapi."; \
158 ntest: all
159 -@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
160 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
161 if test "$$INI_FILE"; then \
162 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
163 else \
164 echo > $(top_builddir)/tmp-php.ini; \
165 fi; \
166 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
167 TEST_PHP_SRCDIR=$(top_srcdir) \
168 CC="$(CC)" \
169 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -N -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
170 else \
171 echo "ERROR: Cannot run tests without CLI sapi."; \
174 clean:
175 find . -name \*.gcno -o -name \*.gcda | xargs rm -f
176 find . -name \*.lo -o -name \*.o | xargs rm -f
177 find . -name \*.la -o -name \*.a | xargs rm -f
178 find . -name \*.so | xargs rm -f
179 find . -name .libs -a -type d|xargs rm -rf
180 rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
182 distclean: clean
183 rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
184 $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
185 find . -name Makefile | xargs rm -f
187 .PHONY: all clean install distclean test
188 .NOEXPORT:
189 cairo.lo: /home/akshat/php-ext/cairo/phpCairo/src/cairo/cairo.c
190 $(LIBTOOL) --mode=compile $(CC) -I. -I/home/akshat/php-ext/cairo/phpCairo/src/cairo $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /home/akshat/php-ext/cairo/phpCairo/src/cairo/cairo.c -o cairo.lo
191 $(phplibdir)/cairo.la: ./cairo.la
192 $(LIBTOOL) --mode=install cp ./cairo.la $(phplibdir)
194 ./cairo.la: $(shared_objects_cairo) $(CAIRO_SHARED_DEPENDENCIES)
195 $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cairo) $(CAIRO_SHARED_LIBADD)