+.PHONY: all build gtags \
+ check \
+ doc info html doc-inner \
+ install uninstall \
+ install-info uninstall-info \
+ install-casl2lib uninstall-casl2lib \
+ version gittag \
+ clean src-clean gtags-clean \
+ test-clean doc-clean doc-inner-clean
+
+CMD := casl2 comet2 dumpword
+
+CAT := cat
+CP := cp
+ECHO := echo
+GITTAG := git tag
+GTAGS := gtags
+INSTALL := install
+SED := sed
+WHICH := which
+
+prefix ?= ~
+bindir ?= $(prefix)/bin
+
+VERSION = $(shell $(CAT) VERSION)
+VERSIONFILES = include/package.h test/system/casl2/opt_v/0.txt test/system/comet2/opt_v/0.txt test/system/dumpword/opt_v/0.txt
+
+all: build doc gtags
+
+build: version
+ $(MAKE) -C src all
+ $(CP) $(addprefix src/,$(CMD)) ./
+
+gtags:
+ $(if $(strip $(shell $(WHICH) $(GTAGS))),$(GTAGS),@$(ECHO) '$(GTAGS): not found')