1
0

[Makefile] Updated.

This commit is contained in:
Alexander Andreev 2022-01-02 22:52:22 +04:00
parent 7f9e3bbc66
commit 5ef2d85eac
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -1,13 +1,9 @@
TARGET=httpprocwatchd
SYSCTL=${shell which systemctl}
SYSDDIR=${shell pkg-config systemd --variable=systemdsystemunitdir}
DESTDIR=/
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}
LDFLAGS=-ldflags "-s -w"
SOURCES := ${wildcard *.go}
@ -18,21 +14,21 @@ ${TARGET}: ${SOURCES}
go build ${LDFLAGS}
install:
install -Dm 0755 ${TARGET} ${INSTALL_BINDIR}/${TARGET}
install -Dm 0644 contrib/config.example.conf ${INSTALL_CONFIGDIR}/config.conf
install -Dm 0644 LICENSE ${INSTALL_LICENSEDIR}/LICENSE
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
install-service:
install -Dm 0644 contrib/systemd/${TARGET}.service ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
install -Dm 0644 contrib/systemd/${TARGET}.service ${DESTDIR}${SYSDDIR}/${TARGET}.service
uninstall:
rm ${INSTALL_BINDIR}/${TARGET}
rm ${INSTALL_LICENSEDIR}/LICENSE
rm ${DESTDIR}usr/bin/${TARGET}
rm ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
uninstall-service:
${SYSCTL} stop ${TARGET}.service
${SYSCTL} disable ${TARGET}.service
rm ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
clean:
go clean