diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-10-27 20:19:46 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-29 13:35:45 +0100 |
| commit | 3cbea071e181cd3fa1bd77be0ec586cf41735e60 (patch) | |
| tree | 6220fb387176cdfe4befa256874db7fad6eb3767 /Makefile | |
| parent | 1190302c13f2eac4ab9e9144c3980cb216879bb0 (diff) | |
| download | vis-3cbea071e181cd3fa1bd77be0ec586cf41735e60.tar.gz vis-3cbea071e181cd3fa1bd77be0ec586cf41735e60.tar.xz | |
build: introduce make local Makefile target
This merges parts of the build system overhaul found in the lua
branch.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 43 |
1 files changed, 41 insertions, 2 deletions
@@ -1,6 +1,17 @@ include config.mk -ALL = *.c *.h config.mk Makefile LICENSE README vis.1 +SRCDIR = $(realpath $(dir $(firstword $(MAKEFILE_LIST)))) + +ALL = *.c *.h config.mk Makefile LICENSE README.md vis.1 + +DEPS_ROOT = $(SRCDIR)/dependency/install +DEPS_PREFIX = $(DEPS_ROOT)/usr +DEPS_BIN = $(DEPS_PREFIX)/bin +DEPS_LIB = $(DEPS_PREFIX)/lib +DEPS_INC = $(DEPS_PREFIX)/include + +LIBTERMKEY = libtermkey-0.18 +LIBTERMKEY_SHA1 = 0a78ba7aaa2f3b53f2273268366fef349c9be4ab all: vis @@ -53,4 +64,32 @@ uninstall: release: @git archive --prefix=vis-$(RELEASE)/ -o vis-$(RELEASE).tar.gz $(RELEASE) -.PHONY: all clean dist install uninstall debug +dependency/sources: + mkdir -p $@ + +dependency/sources/libtermkey-%: | dependency/sources + wget -c -O $@.part http://www.leonerd.org.uk/code/libtermkey/$(LIBTERMKEY).tar.gz + mv $@.part $@ + [ -z $(LIBTERMKEY_SHA1) ] || (echo '$(LIBTERMKEY_SHA1) $@' | sha1sum -c) + +dependency/sources/extract-libtermkey: dependency/sources/$(LIBTERMKEY).tar.gz + tar xzf $< -C $(dir $<) + touch $@ + +dependency/sources/build-libtermkey: dependency/sources/extract-libtermkey + # TODO no sane way to avoid pkg-config and specify LDFLAGS? + sed -i 's/LDFLAGS+=-lncurses$$/LDFLAGS+=-lncursesw/g' $(dir $<)/$(LIBTERMKEY)/Makefile + make -C $(dir $<)/$(LIBTERMKEY) PREFIX=$(DEPS_PREFIX) termkey.h libtermkey.la + touch $@ + +dependency/sources/install-libtermkey: dependency/sources/build-libtermkey + make -C $(dir $<)/$(LIBTERMKEY) PREFIX=$(DEPS_PREFIX) install + touch $@ + +dependencies: dependency/sources/install-libtermkey + +local: dependencies + CFLAGS="$(CFLAGS) -I$(DEPS_INC)" LDFLAGS="$(LDFLAGS) -L$(DEPS_LIB)" make CFLAGS_TERMKEY= LDFLAGS_TERMKEY=-ltermkey + @echo Run with: LD_LIBRARY_PATH=$(DEPS_LIB) ./vis + +.PHONY: all clean dist install uninstall debug profile dependencies local |
