Makefile 687 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. BINOUT := .bin
  2. MAIN_MODULE := embedd/bin
  3. HAREFLAGS ?=
  4. RELEASE ?= 0
  5. ifeq (${RELEASE},1)
  6. HAREFLAGS += -R
  7. endif
  8. LOCAL_HARE := .hare
  9. LOCAL_BIN := ${LOCAL_HARE}/bin
  10. # QBE ?= qbe
  11. # HARE ?= hare
  12. # HAREC ?= harec
  13. QBE ?= ${LOCAL_BIN}/qbe
  14. HARE ?= ${LOCAL_BIN}/hare
  15. HAREC ?= ${LOCAL_BIN}/harec
  16. HARE_STDLIB ?= ${LOCAL_HARE}/stdlib
  17. rwildcard = $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2) \
  18. $(filter $(subst *,%,$2),$d))
  19. .PHONY: all
  20. all: ${BINOUT}/embedd
  21. export QBE
  22. export HAREC
  23. export HAREPATH += :${HARE_STDLIB}
  24. ${BINOUT}/embedd: $(call rwildcard,.,*.ha)
  25. @mkdir -p $(dir ${@})
  26. ${HARE} build ${LDFLAGS} ${HAREFLAGS} -o ${@} ${MAIN_MODULE}
  27. .PHONY: clean
  28. clean:
  29. rm -f embedd