38 lines
956 B
Makefile
38 lines
956 B
Makefile
TARGET=httpprocwatchd
|
|
|
|
SYSCTL=${shell which systemctl}
|
|
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}
|
|
|
|
all: ${TARGET}
|
|
|
|
${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-service:
|
|
install -Dm 0644 contrib/systemd/${TARGET}.service ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
|
|
|
uninstall:
|
|
rm ${INSTALL_BINDIR}/${TARGET}
|
|
rm ${INSTALL_LICENSEDIR}/LICENSE
|
|
|
|
uninstall-service:
|
|
${SYSCTL} stop ${TARGET}.service
|
|
${SYSCTL} disable ${TARGET}.service
|
|
rm ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
|
|
|
clean:
|
|
go clean
|