1
0
Fork 0
httpprocprobed/Makefile

32 lines
655 B
Makefile
Raw Normal View History

2021-03-13 03:17:30 +04:00
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