go-loader-test/Makefile

28 lines
963 B
Makefile
Raw Permalink Normal View History

2023-08-31 20:51:52 +03:00
REPO_NAME=go-loader-test
REPO_LINK=https://git.aliberksandikci.com.tr/asandikci/${REPO_NAME}
DATA_DIR=/etc/go-loader-test/
LIB_DIR=/usr/share/go-loader-test/
PLUGIN_DIR=${LIB_DIR}/plugins/
TEMP_DIR=$(mktemp -d)
MAIN_DIR=${TEMP_DIR}/${REPO_NAME}/
install:
sudo go build -o ${DESTDIR}/usr/bin/${REPO_NAME} ./cmd/go-loader-test/
@sudo mkdir -p "${DESTDIR}/${LIB_DIR}"
@sudo mkdir -p "${DESTDIR}/${PLUGIN_DIR}"
sudo go build -buildmode=plugin -o ${DESTDIR}/${PLUGIN_DIR}/tmptest.so ./plugins/tmptest
@sudo mkdir -p "${DESTDIR}/${DATA_DIR}"
windows_install:
sudo env GOOS=windows GOARCH=amd64 go build -o ${DESTDIR}/usr/bin/${REPO_NAME} ./cmd/go-loader-test/
@sudo mkdir -p "${DESTDIR}/${LIB_DIR}"
@sudo mkdir -p "${DESTDIR}/${PLUGIN_DIR}"
sudo GOOS=windows GOARCH=amd64 go build -buildmode=plugin -o ${DESTDIR}/${PLUGIN_DIR}/tmptest.so ./plugins/tmptest
@sudo mkdir -p "${DESTDIR}/${DATA_DIR}"
uninstall:
@sudo rm -rf ${DESTDIR}/usr/bin/${REPO_NAME}