1
0
Fork 0
httpprocprobed/Makefile

31 lines
820 B
Makefile
Raw Normal View History

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_:/%=%}
DESTDIR:=
2021-03-13 03:17:30 +04:00
VERSION:=3.0.0
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}
.PHONY: install uninstall clean
2021-03-13 03:17:30 +04:00
${TARGET}: ${SOURCES}
go build ${LDFLAGS} ${FLAGS}
2021-03-13 03:17:30 +04:00
install:
2022-01-02 22:52:22 +04:00
install -Dm 0755 ${TARGET} ${DESTDIR}usr/bin/${TARGET}
install -Dm 0644 configs/config.example.json ${DESTDIR}etc/${TARGET}.json
2022-01-02 22:52:22 +04:00
install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${TARGET}.service
2021-03-13 03:17:30 +04:00
uninstall:
2022-01-02 22:52:22 +04:00
rm ${DESTDIR}usr/bin/${TARGET}
rm ${DESTDIR}usr/share/licenses/${TARGET}
2022-01-02 22:52:22 +04:00
rm ${DESTDIR}${SYSDDIR}/${TARGET}.service
clean:
go clean