DISABLE FDs (REMOVE ME).
[jackhill/mal.git] / make / step0_repl.mk
1 #
2 # mal (Make Lisp)
3 #
4 _TOP_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
5 include $(_TOP_DIR)readline.mk
6
7 SHELL := /bin/bash
8
9 define READ
10 $(call READLINE)
11 endef
12
13 define EVAL
14 $(if $(READLINE_EOF),,$(1))
15 endef
16
17 define PRINT
18 $(1)
19 endef
20
21 REP = $(call PRINT,$(strip $(call EVAL,$(strip $(call READ)))))
22 REPL = $(info $(call REP))$(if $(READLINE_EOF),,$(call REPL))
23
24 # Call the read-eval-print loop
25 $(call REPL)