2022-10-10 00:05:38 +04:00
|
|
|
TARGET=httpprocprobed
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2022-01-02 23:05:39 +04:00
|
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
2023-12-15 04:24:33 +04:00
|
|
|
|
2023-12-15 04:00:26 +04:00
|
|
|
DESTDIR:=
|
2023-12-15 04:24:33 +04:00
|
|
|
PREFIX:=/usr/local
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2024-01-13 04:22:34 +04:00
|
|
|
VERSION:=3.1.1
|
2023-12-15 04:00:26 +04:00
|
|
|
|
|
|
|
FLAGS:=-buildmode=pie -modcacherw -mod=readonly -trimpath
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags netgo
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2022-01-02 21:32:34 +04:00
|
|
|
SOURCES := ${wildcard *.go}
|
2022-01-02 05:14:52 +04:00
|
|
|
|
2023-12-15 04:00:26 +04:00
|
|
|
.PHONY: install uninstall clean
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2022-01-02 05:14:52 +04:00
|
|
|
${TARGET}: ${SOURCES}
|
2023-12-15 04:00:26 +04:00
|
|
|
go build ${LDFLAGS} ${FLAGS}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
install:
|
2023-12-15 04:24:33 +04:00
|
|
|
install -Dm 0755 ${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
|
2023-12-16 02:34:10 +04:00
|
|
|
install -Dm 0644 configs/config.example.json ${DESTDIR}/etc/${TARGET}.json
|
2023-12-15 04:24:33 +04:00
|
|
|
install -Dm 0644 LICENSE ${DESTDIR}${PREFIX}/share/licenses/${TARGET}/LICENSE
|
2023-12-15 04:47:31 +04:00
|
|
|
install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${TARGET}.service
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
uninstall:
|
2023-12-15 04:24:33 +04:00
|
|
|
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
|
|
|
|
rm ${DESTDIR}${PREFIX}/share/licenses/${TARGET}
|
2023-12-15 04:44:33 +04:00
|
|
|
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
|
2021-12-24 21:17:36 +04:00
|
|
|
|
|
|
|
clean:
|
2023-12-15 04:11:13 +04:00
|
|
|
rm httpprocprobed
|