X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=Makefile.frag;h=ff6460b7d4d85e27f0790ea46691bc3f10d25f60;hp=81aa007cd2a0c6b5acf98ce2453a44dc701d4c82;hb=ff0048963fcbcddc9de14a3e1c370fcc81d12af7;hpb=7df12c88a4e14611a2585d6e7c994c59e8d7485a diff --git a/Makefile.frag b/Makefile.frag index 81aa007..ff6460b 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -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: @@ -60,3 +59,27 @@ $(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 + +# -- deps + +PHP_PSI_DEPEND = $(patsubst $(PHP_PSI_SRCDIR)/%,$(PHP_PSI_BUILDDIR)/%,$(PHP_PSI_SOURCES:.c=.dep)) + +.PHONY: psi-clean-depend +psi-clean-depend: + -rm -f $(PHP_PSI_DEPEND) $(PHP_PSI_BUILDDIR)/php_psi.dep + +psi-clean: psi-clean-depend + +$(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),) +-include $(PHP_PSI_DEPEND) +-include $(PHP_PSI_BUILDDIR)/php_psi.dep +endif + + +# -- deps