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) $(error Unknown build mode)
endif endif
all: all: lts watcher
go build -ldflags="-X main.LISTEN_PORT=\"$(LISTEN_PORT)\""
watcher: lts: lts.go uuid.go
cc -o watcher watcher.c go build -ldflags="-X main.LISTEN_PORT=$(LISTEN_PORT)"
watcher: watcher.c
cc -o $@ $<
clean: clean:
go clean go clean
rm watcher 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("/etc/", http.FileServerFS(etc))
http.Handle("/store/", http.StripPrefix("/store/", http.FileServer(http.Dir(storePath)))) http.Handle("/store/", http.StripPrefix("/store/", http.FileServer(http.Dir(storePath))))
log.Printf("Listening on %s\n", LISTEN_PORT)
http.ListenAndServe(LISTEN_PORT, nil) http.ListenAndServe(LISTEN_PORT, nil)
doneWatching<-true doneWatching<-true