X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=Makefile.frag;h=597fc45d1b4b2abf025b722fea59064e61f6a35c;hp=c31b9d971f092e2f711cb5bd35d65e26c4d8d9a2;hb=e976ce142e35c97919717acf52618900477a4ade;hpb=1cc295bbc317d62e6ba254a0dcfb00c5a7a5baaa diff --git a/Makefile.frag b/Makefile.frag index c31b9d9..597fc45 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -2,6 +2,7 @@ PHP_PSI_HEADERS := $(addprefix $(PHP_PSI_BUILDDIR)/,$(PHP_PSI_HEADERS)) PHP_PSI_SOURCES := $(addprefix $(PHP_PSI_SRCDIR)/,$(PHP_PSI_SOURCES)) +PHP_PSI_GENERATED:=$(addprefix $(PHP_PSI_SRCDIR)/,$(PHP_PSI_GENERATED)) $(PHP_PSI_BUILDDIR)/types: mkdir -p $@ @@ -10,37 +11,13 @@ $(PHP_PSI_BUILDDIR)/types/%.h: $(PHP_PSI_SRCDIR)/src/types/%.h | $(PHP_PSI_BUILD $(PHP_PSI_BUILDDIR)/%.h: $(PHP_PSI_SRCDIR)/src/%.h @cat >$@ <$< -install-headers: psi-build-headers -clean: psi-clean - -.PHONY: psi-build-headers -psi-build-headers: $(PHP_PSI_HEADERS) - -.PHONY: psi-clean-headers -psi-clean-headers: - -rm -f $(PHP_PSI_HEADERS) - -.PHONY: psi-clean-sources -psi-clean-sources: - -rm -f $(PHP_PSI_BUILDDIR)/src/*o - -rm -f $(PHP_PSI_BUILDDIR)/src/types/*o - -rm -f $(PHP_PSI_SRCDIR)/src/parser.c $(PHP_PSI_SRCDIR)/src/parser_proc.c $(PHP_PSI_SRCDIR)/src/parser_proc.y - -.PHONY: psi-clean-aux -psi-clean-aux: - -rm -f lempar.c lemon.c lemon - -.PHONY: psi-clean -psi-clean: psi-clean-headers psi-clean-sources psi-clean-aux - - -lempar.c: +$(PHP_PSI_BUILDDIR)/lempar.c: curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lempar.c?name=db1bdb4821f2d8fbd76e577cf3ab18642c8d08d1" -lemon.c: +$(PHP_PSI_BUILDDIR)/lemon.c: curl -sSo $@ "http://www.sqlite.org/src/raw/tool/lemon.c?name=5ccba178a8e8a4b21e1c9232944d23973da38ad7" -./lemon: lemon.c | lempar.c +$(PHP_PSI_BUILDDIR)/lemon: $(PHP_PSI_BUILDDIR)/lemon.c | $(PHP_PSI_BUILDDIR)/lempar.c $(CC) -o $@ $< $(PHP_PSI_SRCDIR)/src/parser_proc.h: $(PHP_PSI_SRCDIR)/src/parser_proc.c @@ -57,29 +34,54 @@ $(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 = $(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),) +php_psi_stdinc.h: + +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) +ifneq ($(PSI_DEPS),) -include $(PHP_PSI_DEPEND) --include $(PHP_PSI_BUILDDIR)/php_psi.dep endif +endif + +install-headers: psi-build-headers +.PHONY: psi-clean +clean: psi-clean + +.PHONY: psi-build-headers +psi-build-headers: $(PHP_PSI_HEADERS) + +.PHONY: psi-clean-headers +psi-clean-headers: + -rm -f $(PHP_PSI_HEADERS) + +psi-clean: psi-clean-headers +.PHONY: psi-clean-objects +psi-clean-objects: + -rm -f $(PHP_PSI_BUILDDIR)/src/*o + -rm -f $(PHP_PSI_BUILDDIR)/src/types/*o + +psi-clean: psi-clean-objects + +.PHONY: psi-clean-generated +psi-clean-generated: + -rm -f $(PHP_PSI_GENERATED) + +.PHONY: psi-clean-aux +psi-clean-aux: + -rm -f $(PHP_PSI_BUILDDIR)/lempar.c $(PHP_PSI_BUILDDIR)/lemon.c $(PHP_PSI_BUILDDIR)/lemon + +psi-clean: psi-clean-aux + +.PHONY: psi-clean-depend +psi-clean-depend: + -rm -f $(PHP_PSI_DEPEND) + +psi-clean: psi-clean-depend -# -- deps