TARGET=httpprocprobed SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} SYSDDIR=${SYSDDIR_:/%=%} DESTDIR:= PREFIX:=/usr/local VERSION:=3.1.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}/etc/${TARGET}.json install -Dm 0644 LICENSE ${DESTDIR}${PREFIX}/share/licenses/${TARGET}/LICENSE install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${TARGET}.service uninstall: rm ${DESTDIR}${PREFIX}/bin/${TARGET} rm ${DESTDIR}${PREFIX}/share/licenses/${TARGET} rm ${DESTDIR}${SYSDDIR}/${TARGET}.service clean: rm httpprocprobed