From: Michael Wallner Date: Mon, 5 Dec 2016 11:58:42 +0000 (+0100) Subject: Makefile: optional deps X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=de4f7cc512bbffb5e71290ac48e659dae5e9601d;p=m6w6%2Fext-psi Makefile: optional deps --- diff --git a/.gitignore b/.gitignore index aa984d7..b8e7d88 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,4 @@ php_psi_unions.h /token.h /types.h /types/ +*.d diff --git a/Makefile.frag b/Makefile.frag index e904edf..65e5ed7 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -61,15 +61,25 @@ $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re $(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 -PHP_PSI_DEPEND = $(PHP_PSI_BUILDDIR)/Makefile.deps +# -- deps -depend: psi-depend -.PHONY: psi-depend -psi-depend: $(PHP_PSI_DEPEND) +PHP_PSI_DEPEND = $(PHP_PSI_SOURCES:.c=.d) -$(PHP_PSI_DEPEND): $(PHP_PSI_SOURCES) - $(CC) -MM -MG $(CPPFLAGS) $(DEFS) $(INCLUDES) $^ \ - | $(SED) -e 's/^\(.*\).o: /\1.lo: /' \ - > $@ +.PHONY: psi-clean-depend +psi-clean-depend: + -rm -f $(PHP_PSI_DEPEND) +psi-clean: psi-clean-depend + +%.d: %.c + $(CC) -MM -MG -MF $@ -MT $(patsubst $(PHP_PSI_SRCDIR)/%,$(PHP_PSI_BUILDDIR)/%,$(@:.d=.lo)) \ + $(CPPFLAGS) $(DEFS) $(INCLUDES) $< \ + || touch $@ + +DEPS = +ifneq ($(DEPS),) -include $(PHP_PSI_DEPEND) +endif + + +# -- deps diff --git a/src/calc.h b/src/calc.h index d8f9e18..8e1ea6b 100644 --- a/src/calc.h +++ b/src/calc.h @@ -27,7 +27,7 @@ #define PSI_CALC_H #include "token.h" -#include "impl_val.h" +#include "types/impl_val.h" #define PRIfval "f" #define PRIdval "lf" diff --git a/src/marshal.h b/src/marshal.h index 6fe15c6..8067fb3 100644 --- a/src/marshal.h +++ b/src/marshal.h @@ -26,7 +26,7 @@ #ifndef PSI_MARSHAL_H #define PSI_MARSHAL_H -#include "impl_val.h" +#include "types/impl_val.h" #include "Zend/zend_types.h" struct psi_let_exp; diff --git a/src/types/impl_def_val.h b/src/types/impl_def_val.h index d483d8e..b5530bc 100644 --- a/src/types/impl_def_val.h +++ b/src/types/impl_def_val.h @@ -27,7 +27,7 @@ #define PSI_TYPES_IMPL_DEF_VAL_H #include "token.h" -#include "impl_val.h" +#include "types/impl_val.h" struct psi_data; struct psi_impl_type;