From 61e218e58faf6e8192fd67d0194eeebc9d076137 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 21 Jun 2025 15:03:19 +0200 Subject: [PATCH] Improved makefile --- Makefile | 18 +++++++++++++----- lts.go | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0c2ba90..32ac275 100644 --- a/Makefile +++ b/Makefile @@ -8,15 +8,23 @@ else $(error Unknown build mode) endif -all: - go build -ldflags="-X main.LISTEN_PORT=\"$(LISTEN_PORT)\"" +all: lts watcher -watcher: - cc -o watcher watcher.c +lts: lts.go uuid.go + go build -ldflags="-X main.LISTEN_PORT=$(LISTEN_PORT)" + +watcher: watcher.c + cc -o $@ $< clean: go clean rm watcher -.PHONY: all clean watcher +watch: all + ./watcher . sh -c "make BUILD_MODE=$(BUILD_MODE) && ./lts" + +run: lts + ./lts + +.PHONY: all clean watch run diff --git a/lts.go b/lts.go index 29f041f..232a528 100644 --- a/lts.go +++ b/lts.go @@ -245,6 +245,7 @@ func main() { http.Handle("/etc/", http.FileServerFS(etc)) http.Handle("/store/", http.StripPrefix("/store/", http.FileServer(http.Dir(storePath)))) + log.Printf("Listening on %s\n", LISTEN_PORT) http.ListenAndServe(LISTEN_PORT, nil) doneWatching<-true