From 6a71190f7d4f89ae86ad2407329f5410fd532893 Mon Sep 17 00:00:00 2001 From: hhow09 Date: Sat, 4 May 2024 16:04:33 +0800 Subject: [PATCH] feat: tools makefile (#29) --- Makefile | 11 ++++++++++- README.md | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e443b96..9f12021 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,11 @@ +TOOLS_SOURCE := $(wildcard ./tools/*.go) +tools: + @for file in $(TOOLS_SOURCE); do \ + filename=$$(basename $$file .go); \ + echo "generating tools $$filename"; \ + go build -o ./tools/$$filename $$file; \ + done serve: - ./tools/build && ./tools/serve \ No newline at end of file + ./tools/build && ./tools/serve + +.PHONY: tools diff --git a/README.md b/README.md index 69e3060..810c715 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ learning resources: [resources](./resources.md) details & internals: [docs](./docs) ## Develop Notes +### Setup +1. `make tools` +2. `make serve` to check if everything works fine + ### Add Examples 1. create feature branch 2. add example to `examples.txt` `|<folder-name>` @@ -19,4 +23,4 @@ details & internals: [docs](./docs) 2. `./tools/serve` ## Credits -Template / Framework forked from [Go by Example](https://github.com/mmcgrana/gobyexample). \ No newline at end of file +Template / Framework forked from [Go by Example](https://github.com/mmcgrana/gobyexample).