Skip to content

Commit

Permalink
Makefile updated
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeBalci committed Dec 19, 2023
1 parent 8722871 commit 258f308
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
CURRET_DIR=$(shell pwd)
BINARY=./build/sgn
BUILD=CGO_ENABLED=1 go build
OUT_DIR=${CURRET_DIR}/build
BUILD_FLAGS=-trimpath -buildvcs=false -ldflags="-s -w -X github.com/EgeBalci/sgn/config.Version=$$(git log --pretty=format:'v2.0.1.%at-%h' -n 1)"
STATIC_BUILD_FLAGS=-trimpath -buildvcs=false -ldflags="-extldflags=-static -s -w -X github.com/EgeBalci/sgn/config.Version=$$(git log --pretty=format:'v2.0.1.%at-%h' -n 1)"

# Builds the project
default:
${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/
# Builds the project with full static linking
static:
${BUILD} ${STATIC_BUILD_FLAGS} -o ${OUT_DIR}/
# Installs our project: copies binaries
install:
go install ${BUILD_FLAGS} github.com/EgeBalci/sgn@latest
386:
GOARCH=386 ${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/
linux_amd64:
Expand All @@ -20,3 +26,9 @@ windows_386:
GOOS=windows GOARCH=386 CGO_ENABLED=1 CGO_LDFLAGS="-lkeystone -L${CURRET_DIR}/build/lib32/dll/" CXX=i686-w64-mingw32-g++ CC=i686-w64-mingw32-gcc go build -ldflags="-s -w" -trimpath -o ${OUT_DIR}/sgn32.exe
darwin_amd64:
GOOS=darwin GOARCH=amd64 ${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/

# Cleans our project: deletes binaries
clean:
rm -rf ./build

.PHONY: clean install

0 comments on commit 258f308

Please sign in to comment.