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