Skip to content

Commit 258f308

Browse files
committed
Makefile updated
1 parent 8722871 commit 258f308

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
CURRET_DIR=$(shell pwd)
2+
BINARY=./build/sgn
23
BUILD=CGO_ENABLED=1 go build
34
OUT_DIR=${CURRET_DIR}/build
45
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)"
56
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)"
67

8+
# Builds the project
79
default:
810
${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/
11+
# Builds the project with full static linking
912
static:
1013
${BUILD} ${STATIC_BUILD_FLAGS} -o ${OUT_DIR}/
14+
# Installs our project: copies binaries
15+
install:
16+
go install ${BUILD_FLAGS} github.com/EgeBalci/sgn@latest
1117
386:
1218
GOARCH=386 ${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/
1319
linux_amd64:
@@ -20,3 +26,9 @@ windows_386:
2026
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
2127
darwin_amd64:
2228
GOOS=darwin GOARCH=amd64 ${BUILD} ${BUILD_FLAGS} -o ${OUT_DIR}/
29+
30+
# Cleans our project: deletes binaries
31+
clean:
32+
rm -rf ./build
33+
34+
.PHONY: clean install

0 commit comments

Comments
 (0)