12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- VERSION := 0.1.0
- BINOUT := .bin
- NAME := a
- MAIN_MODULE := ${NAME}/bin
- HAREFLAGS ?=
- RELEASE ?= 0
- ifeq (${RELEASE},1)
- HAREFLAGS += -R
- endif
- LOCAL_HARE := .hare
- LOCAL_BIN := ${LOCAL_HARE}/bin
- # QBE ?= qbe
- # HARE ?= hare
- # HAREC ?= harec
- SCDOC ?= scdoc
- QBE ?= ${LOCAL_BIN}/qbe
- HARE ?= ${LOCAL_BIN}/hare
- HAREC ?= ${LOCAL_BIN}/harec
- HARE_STDLIB ?= ${LOCAL_HARE}/stdlib
- rwildcard = $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2) \
- $(filter $(subst *,%,$2),$d))
- .PHONY: all
- all: ${BINOUT}/${NAME}
- .PHONY: man
- man: man/a.1
- .SUFFIXES: .scd
- .scd:
- $(SCDOC) < ${<} > ${@}
- export QBE
- export HAREC
- .ENV_HAREPATH := ${HAREPATH}
- export HAREPATH = ${HARE_STDLIB}:${.ENV_HAREPATH}
- ${BINOUT}/${NAME}: $(call rwildcard,.,*.ha)
- @mkdir -p $(dir ${@})
- ${HARE} build -D'VERSION="${VERSION}"' ${LDFLAGS} ${HAREFLAGS} -o ${@} ${MAIN_MODULE}
- .PHONY: clean
- clean:
- rm -f ${BINOUT}/${NAME}
- rmdir ${BINOUT}
|