-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Showing
4 changed files
with
66 additions
and
34 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 |
---|---|---|
|
@@ -7,5 +7,4 @@ out | |
passive-* | ||
old-out | ||
http-out | ||
test-scripts | ||
Makefile | ||
test-scripts |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
TARGET ?= jaeles | ||
GO ?= go | ||
GOFLAGS ?= | ||
VERSION := $(shell cat libs/version.go | grep 'VERSION =' | cut -d '"' -f 2 | sed 's/ /\-/g') | ||
|
||
build: | ||
go install | ||
go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET) | ||
|
||
release: | ||
go install | ||
@echo "==> Clean up old builds" | ||
rm -rf ./dist/* | ||
@echo "==> building binaries for for mac intel" | ||
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET) | ||
zip -9 -j dist/$(TARGET)-macos-amd64.zip dist/$(TARGET) && rm -rf ./dist/$(TARGET) | ||
@echo "==> building binaries for for mac M1 chip" | ||
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET) | ||
zip -9 -j dist/$(TARGET)-macos-arm64.zip dist/$(TARGET)&& rm -rf ./dist/$(TARGET) | ||
@echo "==> building binaries for linux intel build on mac" | ||
GOOS=linux GOARCH=amd64 CC="/usr/local/bin/x86_64-linux-musl-gcc" CGO_ENABLED=1 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET) | ||
zip -9 -j dist/$(TARGET)-linux.zip dist/$(TARGET)&& rm -rf ./dist/$(TARGET) | ||
mv dist/$(TARGET)-macos-amd64.zip dist/$(TARGET)-$(VERSION)-macos-amd64.zip | ||
mv dist/$(TARGET)-macos-arm64.zip dist/$(TARGET)-$(VERSION)-macos-arm64.zip | ||
mv dist/$(TARGET)-linux.zip dist/$(TARGET)-$(VERSION)-linux.zip | ||
run: | ||
$(GO) $(GOFLAGS) run *.go | ||
|
||
fmt: | ||
$(GO) $(GOFLAGS) fmt ./...; \ | ||
echo "Done." | ||
|
||
test: | ||
$(GO) $(GOFLAGS) test ./... -v% |
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