From ad18c5370d7460a79d66090745431f95bb069859 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sat, 3 May 2014 15:45:42 +0200 Subject: [PATCH] Fix buildapp dependency. We need a different buildapp binary file for SBCL and for CCL, so make it appear that way in the Makefile, and have both ./build/bin/buildapp.sbcl and ./build/bin/buildapp.ccl. That avoid really confusing error messages when trying to build pgloader with CCL and using the SBCL-compiled buildapp binary... --- Makefile | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 55aa97f..3f06331 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,20 @@ APP_NAME = pgloader # use either sbcl or ccl CL = sbcl +BUILDDIR = build +LIBS = $(BUILDDIR)/libs.stamp +QLDIR = $(BUILDDIR)/quicklisp +MANIFEST = $(BUILDDIR)/manifest.ql +PGLOADER = $(BUILDDIR)/bin/$(APP_NAME) + +BUILDAPP_CCL = $(BUILDDIR)/bin/buildapp.ccl +BUILDAPP_SBCL = $(BUILDDIR)/bin/buildapp.sbcl + ifeq ($(CL),sbcl) +BUILDAPP = $(BUILDAPP_SBCL) CL_OPTS = --no-sysinit --no-userinit else +BUILDAPP = $(BUILDAPP_CCL) CL_OPTS = --no-init endif @@ -26,14 +37,6 @@ BUILDAPP_OPTS = --require sb-posix \ --require sb-rotate-byte endif - -BUILDDIR = build -LIBS = $(BUILDDIR)/libs.stamp -BUILDAPP = $(BUILDDIR)/bin/buildapp -MANIFEST = $(BUILDDIR)/manifest.ql -PGLOADER = $(BUILDDIR)/bin/$(APP_NAME) -QLDIR = $(BUILDDIR)/quicklisp - DEBUILD_ROOT = /tmp/pgloader all: $(PGLOADER) @@ -71,11 +74,18 @@ $(MANIFEST): $(LIBS) manifest: $(MANIFEST) ; -$(BUILDAPP): $(QLDIR)/setup.lisp +$(BUILDAPP_CCL): $(QLDIR)/setup.lisp mkdir -p $(BUILDDIR)/bin $(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \ --eval '(ql:quickload "buildapp")' \ - --eval '(buildapp:build-buildapp "$(BUILDAPP)")' \ + --eval '(buildapp:build-buildapp "$@")' \ + --eval '(quit)' + +$(BUILDAPP_SBCL): $(QLDIR)/setup.lisp + mkdir -p $(BUILDDIR)/bin + $(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \ + --eval '(ql:quickload "buildapp")' \ + --eval '(buildapp:build-buildapp "$@")' \ --eval '(quit)' buildapp: $(BUILDAPP) ;