1
0
httpprocprobed/Makefile

35 lines
789 B
Makefile
Raw Normal View History

2021-03-13 03:17:30 +04:00
TARGET=httpprocwatchd
SYSCTL=${shell which systemctl}
DESTDIR=/
2021-03-13 03:17:30 +04:00
INSTALL_BINDIR=${DESTDIR}usr/bin
INSTALL_CONFIGDIR=${DESTDIR}etc/${TARGET}
INSTALL_SYSDSERVICEDIR=${DESTDIR}usr/lib/systemd/system
2021-03-13 03:17:30 +04:00
LDFLAGS=-ldflags "-s -w"
all: ${TARGET}
2021-03-13 03:17:30 +04:00
${TARGET}: main.go
go build ${LDFLAGS}
2021-03-13 03:17:30 +04:00
install:
install -Dm 0755 ${TARGET} ${INSTALL_BINDIR}/${TARGET}
2022-01-02 02:58:24 +04:00
install -Dm 0644 contrib/config.example.json ${INSTALL_CONFIGDIR}/config.json
2021-03-13 03:17:30 +04:00
install-service:
2022-01-02 02:58:24 +04:00
install -Dm 0644 contrib/systemd/${TARGET}.service ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
${SYSCTL} daemon-reload
2021-03-13 03:17:30 +04:00
uninstall:
rm ${INSTALL_BINDIR}/${TARGET}
2021-03-13 03:17:30 +04:00
uninstall-service:
${SYSCTL} stop ${TARGET}.service
${SYSCTL} disable ${TARGET}.service
rm ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
${SYSCTL} daemon-reload
clean:
go clean