diff --git a/Makefile b/Makefile index fbf3418..7745edc 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,11 @@ POMO_PATCH = $(realpath patches/postmodern-send-copy-done.patch) ASDF_CONFD = ~/.config/common-lisp/source-registry.conf.d ASDF_CONF = $(ASDF_CONFD)/projects.conf +LIBS = build/libs.stamp +BUILDAPP = build/buildapp +MANIFEST = build/manifest.ql +PGLOADER = build/pgloader.exe + docs: pandoc pgloader.1.md -o pgloader.1 pandoc pgloader.1.md -o pgloader.html @@ -34,24 +39,26 @@ $(ASDF_CONF): asdf-config: $(ASDF_CONF) ; -libs: quicklisp $(ASDF_CONF) postmodern cl-csv - # Quicklisp Install needed Common Lisp libs +$(LIBS): quicklisp $(ASDF_CONF) postmodern cl-csv sbcl --load ~/quicklisp/setup.lisp \ --eval '(ql:quickload "pgloader")' \ --eval '(quit)' + touch $@ -./build/manifest.ql: libs +libs: $(LIBS) ; + +$(MANIFEST): libs sbcl --load ~/quicklisp/setup.lisp \ --eval '(ql:write-asdf-manifest-file "./build/manifest.ql")' \ --eval '(quit)' -./build/buildapp: quicklisp +$(BUILDAPP): quicklisp sbcl --load ~/quicklisp/setup.lisp \ --eval '(ql:quickload "buildapp")' \ --eval '(buildapp:build-buildapp "./build/buildapp")' \ --eval '(quit)' -./build/pgloader.exe: ./build/buildapp ./build/manifest.ql +$(PGLOADER): $(MANIFEST) $(BUILDAPP) ./build/buildapp --logfile /tmp/build.log \ --asdf-tree ~/quicklisp/local-projects \ --manifest-file ./build/manifest.ql \ @@ -63,7 +70,11 @@ libs: quicklisp $(ASDF_CONF) postmodern cl-csv --compress-core \ --output build/pgloader.exe -test: ./build/pgloader.exe - $(MAKE) PGLOADER=$(realpath ./build/pgloader.exe) -C test all +pgloader: $(PGLOADER) ; + +test: + $(MAKE) PGLOADER=$(realpath $(PGLOADER)) -C test all check: test ; + +.PHONY: test diff --git a/bootstrap.sh b/bootstrap.sh index 53b64fc..b33ff67 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -18,7 +18,9 @@ echo "local all all trust" | sudo tee $HBA echo "host all all 127.0.0.1/32 trust" | sudo tee -a $HBA sudo pg_ctlcluster 9.3 main reload -sudo createuser -U postgres -SdR `whoami` -sudo createdb -U postgres -O `whoami` pgloader +createuser -U postgres -SdR `whoami` +createdb -U postgres -O `whoami` pgloader +psql -U postgres -d pgloader -c 'create extension ip4r' +make -C /vagrant pgloader make -C /vagrant test diff --git a/test/Makefile b/test/Makefile index d0a64ad..493077d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -2,7 +2,6 @@ TESTS = $(wildcard *.load) OUT = $(TESTS:.load=.out) all: $(OUT) - echo $(OUT) %.out: %.load $(PGLOADER) --verbose $<