Permalink
Browse files

Split the makefile into separate ones for different tasks

  • Loading branch information...
1 parent 4e0fa4c commit b103d5156528670454b9afd9c7f4bfd1a656fb7b Reed Lipman committed Sep 8, 2011
Showing with 207 additions and 209 deletions.
  1. +0 −209 Makefile
  2. +86 −0 src/make/build.mk
  3. +35 −0 src/make/dependencies.mk
  4. +11 −0 src/make/submodules.mk
  5. +56 −0 src/make/ubuntu.mk
  6. +5 −0 src/make/utils.mk
  7. +14 −0 tests/make/test.mk
View
209 Makefile
@@ -53,212 +53,3 @@ help:
@echo " QL_ROOT_NAME = $(QL_ROOT_NAME)"
@echo ' Directory relative to $$HOME of the quicklisp install'
-
-all: fdog $(STAGEDIR) bundle
-
-bundle: $(FDOG).bundle
-$(FDOG).bundle: quicklisp $(STAGEDIR) $(BUILDAPP)
- @echo "=> Bundling up a distributable"
- tar cz -C $(STAGEDIR) -f /tmp/fdog.bundle.tgz .
- $(BUILDAPP) --output $(FDOG).bundle \
- --eval '(sb-ext:disable-debugger)' \
- --load $(QL_ROOT_PATH)/setup.lisp \
- --eval "(ql:quickload :unix-options)" \
- --eval "(ql:quickload :flexi-streams)" \
- --eval "(ql:quickload :external-program)" \
- --eval "(ql:quickload :cl-ppcre)" \
- --load $(ROOT)/src/bundler.lisp \
- --eval '(read-data-from "/tmp/fdog.bundle.tgz")' \
- --entry bundle
- rm -rf /tmp/fdog.bundle.tgz
-
-$(STAGEDIR): $(FODG)
- @echo "=> Preparing release in $(STAGEDIR)"
- mkdir -p $(STAGEDIR)/bin
- cp $(FDOG) $(STAGEDIR)/bin
- mkdir -p $(STAGEDIR)/lib
-
- @echo "=> Archiving revision"
- echo `git rev-parse HEAD` > $(STAGEDIR)/REV
-
-
- @echo "=> Copying native libs"
- cp vendor/libfixposix/build/lib/*.* $(STAGEDIR)/lib
-
- @echo "=> Staging select FFI build libs"
- find vendor/clsql -name '*.dylib' -or -name '*.so' | xargs -I % cp % $(STAGEDIR)/lib
-
- @echo "=> Building bootstrap script: $(STAGEDIR)/fdog"
- touch $(STAGEDIR)/fdog
- @echo '#!/bin/sh' > $(STAGEDIR)/fdog
- @echo 'BASE=$$(dirname $$(readlink -f $$0))' >> $(STAGEDIR)/fdog
- @echo 'LD_LIBRARY_PATH="$$BASE/lib" $$BASE/bin/fdog $$@' >> $(STAGEDIR)/fdog
- chmod +x $(STAGEDIR)/fdog
-
-test: clean init
- @echo "=> Running tests."
- $(MAKE) run-tests
- $(MAKE) clean
-
-run-tests:
- LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(ROOT)/vendor/libfixposix/src/lib/.libs \
- CPATH=$(ROOT)/vendor/libfixposix/src/include \
- $(LISP) --no-userinit \
- --load $(QL_ROOT_PATH)/setup.lisp \
- --eval '(ql:quickload :fdog)' \
- --eval '(ql:quickload :fdog-tests)' \
- --eval '(asdf:test-system :fdog)' \
- --eval '(quit)'
-
-install: all
- @echo "=> Install is disabled while the build is restructured."
-# sudo install -B prev -b $(FDOG) $(DESTDIR)
-
-init: sanity-check submodules quicklisp configured-asdf
-
-submodules:
- git submodule update --init --recursive
- $(MAKE) externals
-
-externals-clean:
- $(MAKE) -C $(ROOT)/vendor clean
-
-externals:
- $(MAKE) -C $(ROOT)/vendor all
-
-fdog: init buildapp $(FDOG)
-$(FDOG):
- @echo "=> Assuring subsystem build"
- LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(ROOT)/vendor/libfixposix/src/lib/.libs \
- CPATH=$(ROOT)/vendor/libfixposix/src/include:$(CPATH) \
- $(LISP) --eval '(sb-ext:disable-debugger)' \
- --eval "(require 'sb-aclrepl)" \
- --eval '(declaim (optimize (debug $(DEBUG))))' \
- --load $(QL_ROOT_PATH)/setup.lisp \
- --eval '(ql:quickload :fdog)' \
- --eval '(quit)'
- @echo "=> Building fdog"
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(ROOT)/vendor/libfixposix/src/lib/.libs \
- CPATH=$(ROOT)/vendor/libfixposix/src/include \
- $(BUILDAPP) --output $(FDOG) \
- --asdf-path $(ROOT) \
- --asdf-tree $(ROOT)/vendor \
- --require sb-aclrepl \
- --eval '(sb-ext:disable-debugger)' \
- --load $(ROOT)/src/builder.lisp \
- --eval '(declaim (optimize (debug $(DEBUG))))' \
- --load $(QL_ROOT_PATH)/setup.lisp \
- --eval '(ql:quickload :fdog)' \
- --dispatched-entry '/fdog-cli:fdog-main' \
- || { echo '[ERROR] Build failed!'; \
- rm -f $(FDOG); exit 1; }
-
-clean-build:
- @echo "=> Removing fdog builds"
- rm -rf $(FDOG)
- @echo "=> Removing the staged release"
- rm -rf $(STAGEDIR)
-
-clean: externals-clean
- @echo "=> Clearing common-lisp cache"
- rm -rf ~/.cache/common-lisp/
- @echo "=> Cleaning up buildapp"
- rm -rf $(BUILDAPP)
- $(MAKE) clean-build
-
-# Dependency targets
-buildapp: quicklisp $(BUILDAPP)
-$(BUILDAPP):
- $(LISP) --eval '(sb-ext:disable-debugger)' \
- --eval '(ql:quickload :buildapp)' \
- --eval '(buildapp:build-buildapp "$(BUILDAPP)")' \
- --eval '(quit)'
-
-QL_TEST ?= $(LISP) --eval '(quit :unix-status (if (find-package :ql) 0 1))'
-QL_URL ?= "https://github.com/quicklisp/quicklisp-bootstrap/raw/master/quicklisp.lisp"
-quicklisp: sanity-check
- $(QL_TEST) || {\
- echo "=> QL is missing. Installing"; \
- curl -L $(QL_URL) > /tmp/quicklisp.lisp; \
- $(LISP) --eval '(sb-ext:disable-debugger)' --load /tmp/quicklisp.lisp \
- --eval '(quicklisp-quickstart:install :path "$(QL_ROOT_PATH)/")' \
- --eval '(ql-util:without-prompting (ql:add-to-init-file))' \
- --eval '(quit)'; \
- }
-
-configured-asdf: configure-asdf-registry $(FDOG_ASDF_CONF_NAME) $(VENDOR_ASDF_CONF_NAME)
-
-configure-asdf-registry:
- @echo "=> Configuring your local lisp to find me."
- @mkdir -p $(REGISTRYD)
-
-$(FDOG_ASDF_CONF_NAME):
- @echo "=> Into: $(FDOG_ASDF_CONF_NAME)"
- @echo "==> Config: $(FDOG_ASDF_CONF)"
- echo "$(FDOG_ASDF_CONF)" > $(FDOG_ASDF_CONF_NAME)
-
-$(VENDOR_ASDF_CONF_NAME):
- @echo "=> Into: $(VENDOR_ASDF_CONF_NAME)"
- @echo "==> Config: $(VENDOR_ASDF_CONF)"
- echo "$(VENDOR_ASDF_CONF)" > $(VENDOR_ASDF_CONF_NAME)
-
-# Utility targets
-sanity-check: $(ROOT)/fdog.asd $(LISP)
- @echo "!> Environment looks sane. I'll allow this."
-
-# Ubuntu buildout
-ubuntu: ubuntu-sbcl ubuntu-mongrel2
-
-MONGREL2_URL_SRC ?= "http://mongrel2.org/static/downloads/mongrel2-1.6.tar.bz2"
-mongrel2: 0mq
- @echo "=> Installing mongrel2"
- rm -rf /tmp/mongrel2-build && \
- mkdir -p /tmp/mongrel2-build && \
- cd /tmp/mongrel2-build && \
- curl $(MONGREL2_URL_SRC) | tar xjf - && \
- cd mongrel2* && \
- make && sudo make install
-
-0MQ_URL_SRC ?= "http://download.zeromq.org/zeromq-2.1.7.tar.gz"
-0mq:
- @echo "=> Installing 0mq"
- rm -rf /tmp/0mq-build && \
- mkdir -p /tmp/0mq-build && \
- cd /tmp/0mq-build && \
- curl $(0MQ_URL_SRC) | tar xzf - && \
- cd zeromq* && \
- ./configure && \
- make && sudo make install && \
- sudo ldconfig
-
-ubuntu-mongrel2: ubuntu-0mq
- @echo "=> Installing Ubuntu mongrel2 deps"
- yes Y | sudo aptitude install sqlite3 libsqlite3-dev
- $(MAKE) mongrel2
-
-ubuntu-0mq: ubuntu-basics
- @echo "=> Installing Ubuntu 0mq deps"
- yes Y | sudo aptitude install uuid-dev
- $(MAKE) 0mq
-
-
-SBCL_URL_BIN ?= "http://prdownloads.sourceforge.net/sbcl/sbcl-1.0.48-x86-64-linux-binary.tar.bz2"
-ubuntu-sbcl: ubuntu-basics
- @echo "=> Fetching/extracting/installing SBCL binary"
- [ -e "$(LISP)" ] && echo "SBCL Already installed." || { \
- rm -rf /tmp/sbcl-build && \
- mkdir -p /tmp/sbcl-build && \
- cd /tmp/sbcl-build && \
- curl -L $(SBCL_URL_BIN) | tar xjf - && \
- cd sbcl* && \
- sudo sh install.sh; \
- }
- @echo "=> Cleaning up"
- rm -rf /tmp/sbcl-build
-
-ubuntu-basics:
- sudo apt-get update
- @echo "=> Making sure we have aptitude"
- yes Y | sudo apt-get install aptitude
- @echo "=> Round one of dependancies"
- yes Y | sudo aptitude install curl build-essential
View
@@ -0,0 +1,86 @@
+all: fdog $(STAGEDIR) bundle
+
+bundle: $(FDOG).bundle
+$(FDOG).bundle: quicklisp $(STAGEDIR) $(BUILDAPP)
+ @echo "=> Bundling up a distributable"
+ tar cz -C $(STAGEDIR) -f /tmp/fdog.bundle.tgz .
+ $(BUILDAPP) --output $(FDOG).bundle \
+ --eval '(sb-ext:disable-debugger)' \
+ --load $(QL_ROOT_PATH)/setup.lisp \
+ --eval "(ql:quickload :unix-options)" \
+ --eval "(ql:quickload :flexi-streams)" \
+ --eval "(ql:quickload :external-program)" \
+ --eval "(ql:quickload :cl-ppcre)" \
+ --load $(ROOT)/src/bundler.lisp \
+ --eval '(read-data-from "/tmp/fdog.bundle.tgz")' \
+ --entry bundle
+ rm -rf /tmp/fdog.bundle.tgz
+
+$(STAGEDIR): $(FODG)
+ @echo "=> Preparing release in $(STAGEDIR)"
+ mkdir -p $(STAGEDIR)/bin
+ cp $(FDOG) $(STAGEDIR)/bin
+ mkdir -p $(STAGEDIR)/lib
+
+ @echo "=> Archiving revision"
+ echo `git rev-parse HEAD` > $(STAGEDIR)/REV
+
+
+ @echo "=> Copying native libs"
+ cp vendor/libfixposix/build/lib/*.* $(STAGEDIR)/lib
+
+ @echo "=> Staging select FFI build libs"
+ find vendor/clsql -name '*.dylib' -or -name '*.so' | xargs -I % cp % $(STAGEDIR)/lib
+
+ @echo "=> Building bootstrap script: $(STAGEDIR)/fdog"
+ touch $(STAGEDIR)/fdog
+ @echo '#!/bin/sh' > $(STAGEDIR)/fdog
+ @echo 'BASE=$$(dirname $$(readlink -f $$0))' >> $(STAGEDIR)/fdog
+ @echo 'LD_LIBRARY_PATH="$$BASE/lib" $$BASE/bin/fdog $$@' >> $(STAGEDIR)/fdog
+ chmod +x $(STAGEDIR)/fdog
+
+install: all
+ @echo "=> Install is disabled while the build is restructured."
+# sudo install -B prev -b $(FDOG) $(DESTDIR)
+
+fdog: init buildapp $(FDOG)
+$(FDOG):
+ @echo "=> Assuring subsystem build"
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(ROOT)/vendor/libfixposix/src/lib/.libs \
+ CPATH=$(ROOT)/vendor/libfixposix/src/include:$(CPATH) \
+ $(LISP) --eval '(sb-ext:disable-debugger)' \
+ --eval "(require 'sb-aclrepl)" \
+ --eval '(declaim (optimize (debug $(DEBUG))))' \
+ --load $(QL_ROOT_PATH)/setup.lisp \
+ --eval '(ql:quickload :fdog)' \
+ --eval '(quit)'
+ @echo "=> Building fdog"
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(ROOT)/vendor/libfixposix/src/lib/.libs \
+ CPATH=$(ROOT)/vendor/libfixposix/src/include \
+ $(BUILDAPP) --output $(FDOG) \
+ --asdf-path $(ROOT) \
+ --asdf-tree $(ROOT)/vendor \
+ --require sb-aclrepl \
+ --eval '(sb-ext:disable-debugger)' \
+ --load $(ROOT)/src/builder.lisp \
+ --eval '(declaim (optimize (debug $(DEBUG))))' \
+ --load $(QL_ROOT_PATH)/setup.lisp \
+ --eval '(ql:quickload :fdog)' \
+ --dispatched-entry '/fdog-cli:fdog-main' \
+ || { echo '[ERROR] Build failed!'; \
+ rm -f $(FDOG); exit 1; }
+
+clean-build:
+ @echo "=> Removing fdog builds"
+ rm -rf $(FDOG)
+ @echo "=> Removing the staged release"
+ rm -rf $(STAGEDIR)
+
+clean: externals-clean
+ @echo "=> Clearing common-lisp cache"
+ rm -rf ~/.cache/common-lisp/
+ @echo "=> Cleaning up buildapp"
+ rm -rf $(BUILDAPP)
+ $(MAKE) clean-build
+
+
View
@@ -0,0 +1,35 @@
+# Dependency targets
+buildapp: quicklisp $(BUILDAPP)
+$(BUILDAPP):
+ $(LISP) --eval '(sb-ext:disable-debugger)' \
+ --eval '(ql:quickload :buildapp)' \
+ --eval '(buildapp:build-buildapp "$(BUILDAPP)")' \
+ --eval '(quit)'
+
+QL_TEST ?= $(LISP) --eval '(quit :unix-status (if (find-package :ql) 0 1))'
+QL_URL ?= "https://github.com/quicklisp/quicklisp-bootstrap/raw/master/quicklisp.lisp"
+quicklisp: sanity-check
+ $(QL_TEST) || {\
+ echo "=> QL is missing. Installing"; \
+ curl -L $(QL_URL) > /tmp/quicklisp.lisp; \
+ $(LISP) --eval '(sb-ext:disable-debugger)' --load /tmp/quicklisp.lisp \
+ --eval '(quicklisp-quickstart:install :path "$(QL_ROOT_PATH)/")' \
+ --eval '(ql-util:without-prompting (ql:add-to-init-file))' \
+ --eval '(quit)'; \
+ }
+
+configured-asdf: configure-asdf-registry $(FDOG_ASDF_CONF_NAME) $(VENDOR_ASDF_CONF_NAME)
+
+configure-asdf-registry:
+ @echo "=> Configuring your local lisp to find me."
+ @mkdir -p $(REGISTRYD)
+
+$(FDOG_ASDF_CONF_NAME):
+ @echo "=> Into: $(FDOG_ASDF_CONF_NAME)"
+ @echo "==> Config: $(FDOG_ASDF_CONF)"
+ echo "$(FDOG_ASDF_CONF)" > $(FDOG_ASDF_CONF_NAME)
+
+$(VENDOR_ASDF_CONF_NAME):
+ @echo "=> Into: $(VENDOR_ASDF_CONF_NAME)"
+ @echo "==> Config: $(VENDOR_ASDF_CONF)"
+ echo "$(VENDOR_ASDF_CONF)" > $(VENDOR_ASDF_CONF_NAME)
View
@@ -0,0 +1,11 @@
+submodules:
+ git submodule update --init --recursive
+ $(MAKE) externals
+
+externals-clean:
+ $(MAKE) -C $(ROOT)/vendor clean
+
+externals:
+ $(MAKE) -C $(ROOT)/vendor all
+
+
Oops, something went wrong.

0 comments on commit b103d51

Please sign in to comment.