Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardottt committed Dec 20, 2020
1 parent 7462975 commit 34b6b28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
36 changes: 7 additions & 29 deletions Makefile
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."
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ go 1.14
require (
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef
github.com/fatih/color v1.10.0
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 h1:+CBz4km/0KPU3RGTwARGh/noP3bEwtHcq+0YcBQM2JQ=
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

0 comments on commit 34b6b28

Please sign in to comment.