1
0
Fork 0
httpprocprobed/Makefile

40 lines
982 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
INSTALL_LICENSEDIR=${DESTDIR}usr/share/licenses/${TARGET}
2021-03-13 03:17:30 +04:00
LDFLAGS=-ldflags "-s -w"
SOURCES := main.go ${wildcard prog/*.go}
all: ${TARGET}
2021-03-13 03:17:30 +04:00
${TARGET}: ${SOURCES}
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
install -Dm 0644 LICENSE ${INSTALL_LICENSEDIR}/LICENSE
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}
rm ${INSTALL_LICENSEDIR}/LICENSE
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