1
0
httpprocprobed/Makefile

38 lines
956 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}${shell pkg-config systemd --variable=systemdsystemunitdir}
INSTALL_LICENSEDIR=${DESTDIR}usr/share/licenses/${TARGET}
2021-03-13 03:17:30 +04:00
LDFLAGS=-ldflags "-s -w"
2022-01-02 21:32:34 +04:00
SOURCES := ${wildcard *.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 22:05:18 +04:00
install -Dm 0644 contrib/config.example.conf ${INSTALL_CONFIGDIR}/config.conf
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
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
clean:
go clean