An extensible POSIX-compatible implementation of the ed(1) text editor
git clone https://git.8pit.net/edward.git
1# This Makefile is a wrapper around chicken-install(1) which eases building 2# edward without superuser rights and without requiring any configuration 3# of chicken-install. Furthermore, it supports optional dependency vendoring 4# to build edward without network access. 5# 6# By default, the Makefile builds a statically linked binary. For development 7# purposes it can be desirable to do dynamic linked builds instead. To do so 8# the PACKAGE environment variable can be set to zero. 9PREFIX ?= /usr/local10BINDIR ?= $(PREFIX)/bin11DOCDIR ?= $(PREFIX)/share/doc/edward1213# By default, build a statically linked version for packaging.14# If package is zero, build a dynamically linked version instead.15PACKAGE ?= 116ifneq ($(PACKAGE),0)17 INSTALL_FLAGS = -feature package18endif1920# Install all CHICKEN files relative to ./output21#22# See: https://bugs.call-cc.org/ticket/17922324# Respect CHICKEN_REPOSITORY_PATH if set in the environment25CHICKEN_REPOSITORY_PATH ?= $(shell env -i chicken-install -repository)2627export CHICKEN_INSTALL_PREFIX := $(CURDIR)/output28export CHICKEN_INSTALL_REPOSITORY := $(CURDIR)/output29export CHICKEN_REPOSITORY_PATH := $(CURDIR)/output:$(CHICKEN_REPOSITORY_PATH)3031# Optional dependency vendoring to build without network access32#33# Release tarballs include vendored dependencies (see make dist).3435VENDOR_DIRECTORY = $(CURDIR)/vendor36ifneq ($(wildcard $(VENDOR_DIRECTORY)/*),)37 VENDORED=138endif3940all:41ifdef VENDORED42 chicken-install -location $(VENDOR_DIRECTORY) $(shell ls $(VENDOR_DIRECTORY))43endif44 chicken-install $(INSTALL_FLAGS)4546check: export EDWARD=$(CHICKEN_INSTALL_PREFIX)/bin/edward47check:48 chicken-install -test49 @./tests/integration/run.sh50 @./tests/interactive/run.sh5152bench:53 csi -quiet -script benchmarks/run.scm5455install:56 install -Dm755 $(CHICKEN_INSTALL_PREFIX)/bin/edward "$(DESTDIR)$(BINDIR)/edward"57 install -Dm644 README.md "$(DESTDIR)$(DOCDIR)/README.md"5859vendor:60 env -i CHICKEN_EGG_CACHE=$(VENDOR_DIRECTORY) chicken-install -r -recursive -test61 find $(VENDOR_DIRECTORY) \( -name STATUS -a -type f \) -exec rm {} +62# XXX: Make sure to remove the vendor directory before running `make dist`.63# As libraries are, unfortunately, build within the vendor directory.64dist: VERSION = $(shell git describe --tags)65dist: vendor66 mkdir -p edward-$(VERSION)67 cp -R LICENSE.txt GNUmakefile README.md bin edward.egg lib tests vendor edward-$(VERSION)68 tar -czf edward-$(VERSION).tar.gz edward-$(VERSION)69 rm -rf edward-$(VERSION)7071.PHONY: all check bench install vendor dist