2021-03-13 03:17:30 +04:00
|
|
|
TARGET=httpprocwatchd
|
|
|
|
|
2021-12-24 21:17:36 +04:00
|
|
|
SYSCTL=${shell which systemctl}
|
2022-01-02 22:52:22 +04:00
|
|
|
SYSDDIR=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
2021-12-24 21:17:36 +04:00
|
|
|
DESTDIR=/
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
LDFLAGS=-ldflags "-s -w"
|
|
|
|
|
2022-01-02 21:32:34 +04:00
|
|
|
SOURCES := ${wildcard *.go}
|
2022-01-02 05:14:52 +04:00
|
|
|
|
2021-12-24 21:17:36 +04:00
|
|
|
all: ${TARGET}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2022-01-02 05:14:52 +04:00
|
|
|
${TARGET}: ${SOURCES}
|
2021-12-24 21:17:36 +04:00
|
|
|
go build ${LDFLAGS}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
install:
|
2022-01-02 22:52:22 +04:00
|
|
|
install -Dm 0755 ${TARGET} ${DESTDIR}usr/bin/${TARGET}
|
|
|
|
install -Dm 0644 contrib/config.example.conf ${DESTDIR}etc/${TARGET}/config.conf
|
|
|
|
install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
install-service:
|
2022-01-02 22:52:22 +04:00
|
|
|
install -Dm 0644 contrib/systemd/${TARGET}.service ${DESTDIR}${SYSDDIR}/${TARGET}.service
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
uninstall:
|
2022-01-02 22:52:22 +04:00
|
|
|
rm ${DESTDIR}usr/bin/${TARGET}
|
|
|
|
rm ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
uninstall-service:
|
2021-12-24 21:17:36 +04:00
|
|
|
${SYSCTL} stop ${TARGET}.service
|
|
|
|
${SYSCTL} disable ${TARGET}.service
|
2022-01-02 22:52:22 +04:00
|
|
|
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
|
2021-12-24 21:17:36 +04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|