From 008e30ad1d9e27cd0d5ff8c537f0cd6670294613 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 3 Feb 2017 13:19:35 +0100 Subject: [PATCH] configure: generate lemon in the build dir, too --- Makefile.frag | 71 +++++++++++++++++++++++++-------------------------- m4/psi/psi.m4 | 2 +- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Makefile.frag b/Makefile.frag index 4d3d726..2d05638 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -10,37 +10,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,16 +33,8 @@ $(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 $@ $< -# -- 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) - -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) $< \ @@ -80,5 +48,36 @@ ifneq ($(PSI_DEPS),) 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-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 + +psi-clean: psi-clean-sources + +.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 diff --git a/m4/psi/psi.m4 b/m4/psi/psi.m4 index b0e30f4..5692e71 100644 --- a/m4/psi/psi.m4 +++ b/m4/psi/psi.m4 @@ -275,7 +275,7 @@ AC_DEFUN(PSI_LEMON, [ AC_ARG_VAR(LEMON, The lemon parser generator of the SQLite project) if test -z "$LEMON" then - AC_PATH_PROG(LEMON, lemon, ./lemon) + AC_PATH_PROG(LEMON, lemon, $PHP_PSI_BUILDDIR/lemon) fi PHP_SUBST(LEMON) ]) -- 2.30.2