-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7462975
commit 34b6b28
Showing
3 changed files
with
10 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,33 @@ | ||
TARGET=build | ||
ARCHS=amd64 386 | ||
LDFLAGS="-s -w" | ||
GCFLAGS="all=-trimpath=$(shell pwd)" | ||
ASMFLAGS="all=-trimpath=$(shell pwd)" | ||
PWD="$(shell pwd)" | ||
DOLLAR="$" | ||
REPO=github.com/edoardottt/scilla | ||
|
||
fmt: | ||
@gofmt -s ./*; \ | ||
echo "Done." | ||
|
||
remod: | ||
rm -rf go.* | ||
go mod init github.com/edoardottt/scilla | ||
go mod init ${REPO} | ||
go get | ||
echo "Done." | ||
|
||
update: | ||
@go get -u; \ | ||
go mod tidy -v; \ | ||
echo "Done." | ||
|
||
windows: | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Building for windows $${GOARCH} ..." ; \ | ||
mkdir -p ${TARGET}/scilla-windows-$${GOARCH} ; \ | ||
mv lists/ ${GOPATH}/bin; \ | ||
GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/scilla-windows-$${GOARCH}/scilla.exe ; \ | ||
done; \ | ||
echo "Done." | ||
|
||
linux: | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Building for linux $${GOARCH}; \ | ||
echo "export PATH=${PWD}/${TARGET}/scilla-linux-$${GOARCH}:${DOLLAR}PATH"; \ | ||
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/scilla-linux-$${GOARCH}/scilla ; \ | ||
done; \ | ||
@go build -o ./scilla | ||
sudo mv ./scilla /usr/bin/ | ||
echo "Done." | ||
|
||
unlinux: | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Unlinuxing for linux $${GOARCH} ..." ; \ | ||
rm -rf /bin/lists; \ | ||
rm -rf /bin/scilla; \ | ||
done; \ | ||
sudo rm -rf /usr/bin/scilla | ||
echo "Done." | ||
|
||
test: | ||
@go test -v -race ./... ; \ | ||
echo "Done." | ||
|
||
clean: | ||
@rm -rf ${TARGET}/* ; \ | ||
go clean ./... ; \ | ||
echo "Done." | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters