Code

rrd_flush.c: Provide a more useful error message.
[rrdtool-all.git] / contrib / php4 / build / rules.mk
1 # Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
5 # are met:
6 # 1. Redistributions of source code must retain the above copyright
7 #    notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright
9 #    notice, this list of conditions and the following disclaimer in the
10 #    documentation and/or other materials provided with the distribution.
11
12 # THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
13 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15 # EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
16 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
18 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
19 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 #
23 ##############################################################################
24 # $Id$ 
25 #
27 include $(top_builddir)/config_vars.mk
29 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
30 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
31 CCLD = $(CC)
32 LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
33 mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
34 INSTALL = $(top_srcdir)/build/shtool install -c
35 INSTALL_DATA = $(INSTALL) -m 644
36 SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
37 DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
39 moduledir    = $(EXTENSION_DIR)
41 .SUFFIXES:
42 .SUFFIXES: .slo .c .lo .o .s .y .l
44 .c.o:
45         $(COMPILE) -c $<
47 .s.o:
48         $(COMPILE) -c $<
50 .c.lo:
51         $(PHP_COMPILE)
53 .s.lo:
54         $(PHP_COMPILE)
56 .c.slo:
57         $(SHARED_COMPILE)
59 .y.c:
60         $(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
61         if test -f y.tab.h; then \
62         if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
63         else :; fi
65 .l.c:
66         $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
68 install_targets = install-modules
70 all: all-recursive
71 install: install-recursive
73 distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
74         @otarget=`echo $@|sed s/-recursive//`; \
75         list='$(SUBDIRS)'; for i in $$list; do \
76                 target="$$otarget"; \
77                 echo "Making $$target in $$i"; \
78                 if test "$$i" = "."; then \
79                         ok=yes; \
80                         target="$$target-p"; \
81                 fi; \
82                 (cd $$i && $(MAKE) $$target) || exit 1; \
83         done; \
84         if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
85         if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
87 all-p: $(targets)
88 install-p: $(targets) $(install_targets)
89 distclean-p depend-p clean-p:
91 depend: depend-recursive
92         test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
94 clean: clean-recursive clean-x
96 clean-x:
97         rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
98         rm -rf .libs
100 distclean: distclean-recursive clean-x
101         rm -f config.cache config.log config.status config_vars.mk libtool \
102         php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
104 install-modules:
105         @test -d modules && \
106         $(mkinstalldirs) $(moduledir) && \
107         echo "installing shared modules into $(moduledir)" && \
108         rm -f modules/*.la && \
109         cp modules/* $(moduledir) || true
111 include $(builddir)/.deps
113 .PHONY: all-recursive clean-recursive install-recursive \
114 $(install_targets) install all clean depend depend-recursive shared \
115 distclean-recursive distclean clean-x all-p install-p distclean-p \
116 depend-p clean-p