35 lines
789 B
Makefile
35 lines
789 B
Makefile
TARGET=httpprocwatchd
|
|
|
|
SYSCTL=${shell which systemctl}
|
|
DESTDIR=/
|
|
|
|
INSTALL_BINDIR=${DESTDIR}usr/bin
|
|
INSTALL_CONFIGDIR=${DESTDIR}etc/${TARGET}
|
|
INSTALL_SYSDSERVICEDIR=${DESTDIR}usr/lib/systemd/system
|
|
|
|
LDFLAGS=-ldflags "-s -w"
|
|
|
|
all: ${TARGET}
|
|
|
|
${TARGET}: main.go
|
|
go build ${LDFLAGS}
|
|
|
|
install:
|
|
install -Dm 0755 ${TARGET} ${INSTALL_BINDIR}/${TARGET}
|
|
install -Dm 0644 contrib/config.example.json ${INSTALL_CONFIGDIR}/config.json
|
|
|
|
install-service:
|
|
install -Dm 0644 contrib/systemd/${TARGET}.service ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
|
${SYSCTL} daemon-reload
|
|
|
|
uninstall:
|
|
rm ${INSTALL_BINDIR}/${TARGET}
|
|
|
|
uninstall-service:
|
|
${SYSCTL} stop ${TARGET}.service
|
|
${SYSCTL} disable ${TARGET}.service
|
|
rm ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
|
${SYSCTL} daemon-reload
|
|
|
|
clean:
|
|
go clean
|