32 lines
655 B
Makefile
32 lines
655 B
Makefile
|
TARGET=httpprocwatchd
|
||
|
|
||
|
SYSCTL=$(shell which systemctl)
|
||
|
|
||
|
CONFDIR=/etc/$(TARGET)
|
||
|
SYSDSERVICEDIR=/etc/systemd/system
|
||
|
|
||
|
LDFLAGS=-ldflags "-s -w"
|
||
|
|
||
|
all: $(TARGET)
|
||
|
|
||
|
$(TARGET): main.go
|
||
|
go build $(LDFLAGS)
|
||
|
|
||
|
install:
|
||
|
install -m 0755 $(TARGET) /usr/bin/$(TARGET)
|
||
|
mkdir -p -m 0755 $(CONFDIR)
|
||
|
install -m 0644 config.example.json $(CONFDIR)/config.example.json
|
||
|
|
||
|
install-service:
|
||
|
install -m 0644 $(TARGET).service $(SYSDSERVICEDIR)/$(TARGET).service
|
||
|
$(SYSCTL) daemon-reload
|
||
|
|
||
|
uninstall:
|
||
|
rm /usr/bin/$(TARGET)
|
||
|
|
||
|
uninstall-service:
|
||
|
$(SYSCTL) stop $(TARGET).service
|
||
|
$(SYSCTL) disable $(TARGET).service
|
||
|
rm $(SYSDSERVICEDIR)/$(TARGET).service
|
||
|
$(SYSCTL) daemon-reload
|