You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
782 B
25 lines
782 B
BINARY_NAME=keyboard-reader
|
|
LD_FLAGS="-s -w -buildid="$(shell git rev-parse HEAD)
|
|
|
|
build:
|
|
#GOARCH=amd64 GOOS=linux go build -o ${BINARY_NAME} -trimpath -ldflags ${LD_FLAGS} -tags netgo
|
|
go build -o ${BINARY_NAME} -ldflags ${LD_FLAGS} -tags netgo
|
|
|
|
run: build
|
|
./${BINARY_NAME} --list
|
|
|
|
clean:
|
|
go clean
|
|
rm ./debian/opt/ocppc/bin/${BINARY_NAME} || true
|
|
rm -rf ./build || true
|
|
docker container rm ${BINARY_NAME} || true
|
|
docker image rm ${BINARY_NAME} || true
|
|
|
|
deb: clean build
|
|
cp ${BINARY_NAME} ./debian/opt/ocppc/bin/
|
|
cd ./debian && dpkg-buildpackage -rfakeroot --no-sign --target-arch amd64 --host-arch amd64
|
|
|
|
docker-deb: clean
|
|
docker image build -t ${BINARY_NAME} .
|
|
docker container run --name ${BINARY_NAME} ${BINARY_NAME}
|
|
docker container cp ${BINARY_NAME}:/data ./build
|
|
|