configure: generate less files, and do that in build dir
[m6w6/ext-psi] / Makefile.frag
index 65e5ed7751993fdbe4d12d2ad660e5350d57dfc0..4d3d726f0db229cfb65341062723318f37f6c62b 100644 (file)
@@ -19,7 +19,6 @@ psi-build-headers: $(PHP_PSI_HEADERS)
 .PHONY: psi-clean-headers
 psi-clean-headers:
        -rm -f $(PHP_PSI_HEADERS)
-       -rmdir $(PHP_PSI_BUILDDIR)/types
 
 .PHONY: psi-clean-sources
 psi-clean-sources:
@@ -36,10 +35,10 @@ psi-clean: psi-clean-headers psi-clean-sources psi-clean-aux
 
 
 lempar.c:
-       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=3ec1463a034b37d87d782be5f6b8b10a3b1ecbe7"
+       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=db1bdb4821f2d8fbd76e577cf3ab18642c8d08d1"
 
 lemon.c:
-       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=799e73e19a33b8dd7767a7fa34618ed2a9c2397d"
+       curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=5ccba178a8e8a4b21e1c9232944d23973da38ad7"
 
 ./lemon: lemon.c | lempar.c
        $(CC) -o $@ $<
@@ -58,12 +57,9 @@ $(PHP_PSI_SRCDIR)/src/parser.re: $(PHP_PSI_SRCDIR)/src/parser_proc.h
 $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
        $(RE2C) -o $@ $<
 
-$(PHP_PSI_SRCDIR)/src/types/decl.c: $(PHP_PSI_SRCDIR)/php_psi_macros.h $(PHP_PSI_SRCDIR)/php_psi_redirs.h
-$(PHP_PSI_SRCDIR)/src/context.c: $(PHP_PSI_SRCDIR)/php_psi_consts.h $(PHP_PSI_SRCDIR)/php_psi_decls.h $(PHP_PSI_SRCDIR)/php_psi_fn_decls.h $(PHP_PSI_SRCDIR)/php_psi_structs.h $(PHP_PSI_SRCDIR)/php_psi_types.h $(PHP_PSI_SRCDIR)/php_psi_unions.h $(PHP_PSI_SRCDIR)/php_psi_va_decls.h
-
 # -- deps
 
-PHP_PSI_DEPEND = $(PHP_PSI_SOURCES:.c=.d)
+PHP_PSI_DEPEND = $(patsubst $(PHP_PSI_SRCDIR)/%,$(PHP_PSI_BUILDDIR)/%,$(PHP_PSI_SOURCES:.c=.dep))
 
 .PHONY: psi-clean-depend
 psi-clean-depend:
@@ -71,15 +67,18 @@ psi-clean-depend:
 
 psi-clean: psi-clean-depend
 
-%.d: %.c
-       $(CC) -MM -MG -MF $@ -MT $(patsubst $(PHP_PSI_SRCDIR)/%,$(PHP_PSI_BUILDDIR)/%,$(@:.d=.lo)) \
+$(PHP_PSI_BUILDDIR)/%.dep: $(PHP_PSI_SRCDIR)/%.c
+       $(CC) -MM -MG -MF $@ -MT $(patsubst $(PHP_PSI_SRCDIR)/%,$(PHP_PSI_BUILDDIR)/%,$(@:.dep=.lo)) \
                $(CPPFLAGS) $(DEFS) $(INCLUDES) $< \
                        || touch $@
 
-DEPS = 
-ifneq  ($(DEPS),)
+php_psi_stdinc.h:
+
+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
+ifneq ($(PSI_DEPS),)
 -include $(PHP_PSI_DEPEND)
 endif
+endif
 
 
 # -- deps