| 1 | PKG_NAME := tt |
| 2 | EXE_FILE := $(PKG_NAME) |
| 3 | SRC_FILE := $(EXE_FILE).rkt |
| 4 | PREFIX := $(HOME) |
| 5 | |
| 6 | .PHONY: build |
| 7 | build: $(EXE_FILE) |
| 8 | |
| 9 | $(EXE_FILE): $(SRC_FILE) |
| 10 | raco exe -o $@ $< |
| 11 | |
| 12 | .PHONY: install |
| 13 | install: $(EXE_FILE) |
| 14 | mkdir -p $(PREFIX)/bin/ |
| 15 | cp $(EXE_FILE) $(PREFIX)/bin/ |
| 16 | |
| 17 | .PHONY: test |
| 18 | test: |
| 19 | raco test ./$(SRC_FILE) |
| 20 | |
| 21 | .PHONY: remove |
| 22 | remove: |
| 23 | raco pkg remove $(PKG_NAME) |
| 24 | |
| 25 | .PHONY: clean |
| 26 | clean: |
| 27 | rm -f $(EXE_FILE) |
| 28 | |
| 29 | ### dev helpers ### |
| 30 | # scmindent.rkt : https://github.com/ds26gte/scmindent |
| 31 | # sponge : https://joeyh.name/code/moreutils |
| 32 | .PHONY: indent |
| 33 | indent: |
| 34 | scmindent.rkt < $(SRC_FILE) | sponge $(SRC_FILE) |