1
0
httpprocprobed/Makefile

33 lines
892 B
Makefile

TARGET=httpprocprobed
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR:=
PREFIX:=/usr/local
VERSION:=3.0.0
FLAGS:=-buildmode=pie -modcacherw -mod=readonly -trimpath
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags netgo
SOURCES := ${wildcard *.go}
.PHONY: install uninstall clean
${TARGET}: ${SOURCES}
go build ${LDFLAGS} ${FLAGS}
install:
install -Dm 0755 ${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
install -Dm 0644 configs/config.example.json ${DESTDIR}${PREFIX}/etc/${TARGET}.json
install -Dm 0644 LICENSE ${DESTDIR}${PREFIX}/share/licenses/${TARGET}/LICENSE
install -Dm 0644 init/systemd.service ${DESTDIR}${PREFIX}${SYSDDIR}/${TARGET}.service
uninstall:
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
rm ${DESTDIR}${PREFIX}/share/licenses/${TARGET}
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
clean:
rm httpprocprobed