forked from rakyll/drive
-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile for cross compilation added
Added a Makefile for cross compilation during releases and to democratize compilation for users themselves. Updates #662.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin/ | ||
md5Sums.txt |
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,35 @@ | ||
# Makefile for cross-compilation | ||
# | ||
OS := $(shell uname) | ||
BINDIR := ./bin | ||
MD5_TEXTFILE := $(BINDIR)/md5Sums.txt | ||
|
||
MAIN_FILE_DIR := ./cmd/drive | ||
|
||
ifeq ($(OS), Darwin) | ||
MD5_UTIL = md5 | ||
else | ||
MD5_UTIL = md5sum | ||
endif | ||
|
||
all: compileThemAll md5SumThemAll | ||
|
||
compileThemAll: armv5 armv6 armv7 armv8 darwin linux | ||
|
||
md5SumThemAll: | ||
rm -f $(MD5_TEXTFILE) | ||
find $(BINDIR) -type f -name "drive_*" -exec $(MD5_UTIL) {} >> $(MD5_TEXTFILE) \; | ||
cat $(MD5_TEXTFILE) | ||
|
||
armv5: | ||
CGO_ENABLED=0 GOOS=linux GOARM=5 GOARCH=arm go build -o $(BINDIR)/drive_armv5 $(MAIN_FILE_DIR) | ||
armv6: | ||
CGO_ENABLED=0 GOOS=linux GOARM=6 GOARCH=arm go build -o $(BINDIR)/drive_armv6 $(MAIN_FILE_DIR) | ||
armv7: | ||
CGO_ENABLED=0 GOOS=linux GOARM=7 GOARCH=arm go build -o $(BINDIR)/drive_armv7 $(MAIN_FILE_DIR) | ||
armv8: | ||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BINDIR)/drive_armv8 $(MAIN_FILE_DIR) | ||
darwin: | ||
CGO_ENABLED=0 GOOS=darwin go build -o $(BINDIR)/drive_darwin $(MAIN_FILE_DIR) | ||
linux: | ||
CGO_ENABLED=0 GOOS=linux go build -o $(BINDIR)/drive_linux $(MAIN_FILE_DIR) |
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