mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-21 16:05:40 +00:00
make: build for several platfom/arches
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
ca8faa91ae
commit
9fc0375857
2 changed files with 16 additions and 0 deletions
|
@ -16,3 +16,4 @@ install: true
|
|||
script:
|
||||
- make validation
|
||||
- make validation.tags
|
||||
- make build.arches
|
||||
|
|
15
Makefile
15
Makefile
|
@ -4,6 +4,7 @@ CWD := $(shell pwd)
|
|||
SOURCE_FILES := $(shell find . -type f -name "*.go")
|
||||
CLEAN_FILES := *~
|
||||
TAGS := cvis
|
||||
ARCHES := linux,386 linux,amd64 linux,arm linux,arm64 openbsd,amd64 windows,amd64 darwin,amd64
|
||||
|
||||
default: build validation
|
||||
|
||||
|
@ -60,6 +61,20 @@ build: $(BUILD)
|
|||
$(BUILD): $(SOURCE_FILES)
|
||||
go build ./cmd/$(BUILD)
|
||||
|
||||
./bin:
|
||||
mkdir -p $@
|
||||
|
||||
CLEAN_FILES += bin
|
||||
|
||||
build.arches: ./bin
|
||||
@set -e ;\
|
||||
for pair in $(ARCHES); do \
|
||||
p=$$(echo $$pair | cut -d , -f 1);\
|
||||
a=$$(echo $$pair | cut -d , -f 2);\
|
||||
echo "Building $$p/$$a ...";\
|
||||
GOOS=$$p GOARCH=$$a go build -o ./bin/gomtree.$$p.$$a ./cmd/gomtree/ ;\
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD) $(CLEAN_FILES)
|
||||
|
||||
|
|
Loading…
Reference in a new issue