Improved makefile
This commit is contained in:
18
Makefile
18
Makefile
@ -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
1
lts.go
@ -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
|
||||||
|
Reference in New Issue
Block a user