Improved makefile

This commit is contained in:
kamkow1
2025-06-21 15:03:19 +02:00
parent 59bb805ecd
commit 61e218e58f
2 changed files with 14 additions and 5 deletions

View File

@ -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

1
lts.go
View File

@ -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