e6dl/Makefile

43 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

2019-03-01 03:47:50 +08:00
.PHONY: dist dist-win dist-macos dist-linux ensure-dist-dir build install uninstall
GOBUILD=go build -ldflags="-s -w"
INSTALLPATH=/usr/local/bin
ensure-dist-dir:
@- mkdir -p dist
dist-win: ensure-dist-dir
# Build for Windows x64
2019-03-14 03:16:40 +08:00
GOOS=windows GOARCH=amd64 $(GOBUILD) -o dist/e6dl-windows-amd64.exe main.go
2019-03-01 03:47:50 +08:00
dist-macos: ensure-dist-dir
# Build for macOS x64
2019-03-14 03:16:40 +08:00
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o dist/e6dl-darwin-amd64 main.go
2019-03-01 03:47:50 +08:00
2022-05-06 02:02:35 +08:00
# Build for macOS ARM
GOOS=darwin GOARCH=arm64 $(GOBUILD) -o dist/e6dl-darwin-arm64 main.go
2019-03-01 03:47:50 +08:00
dist-linux: ensure-dist-dir
# Build for Linux x64
2019-03-14 03:16:40 +08:00
GOOS=linux GOARCH=amd64 $(GOBUILD) -o dist/e6dl-linux-amd64 main.go
2019-03-01 03:47:50 +08:00
2022-05-06 02:02:35 +08:00
# Build for Linux PPC64
GOOS=linux GOARCH=ppc64 $(GOBUILD) -o dist/e6dl-linux-ppc64 main.go
2019-03-01 03:47:50 +08:00
dist: dist-win dist-macos dist-linux
build:
@- mkdir -p bin
2019-03-14 03:16:40 +08:00
$(GOBUILD) -o bin/e6dl main.go
2019-03-01 03:47:50 +08:00
@- chmod +x bin/e6dl
install: build
mv bin/e6dl $(INSTALLPATH)/e6dl
@- rm -rf bin
@echo "e6dl was installed to $(INSTALLPATH)/e6dl. Run make uninstall to get rid of it, or just remove the binary yourself."
uninstall:
2019-03-01 08:58:48 +08:00
rm $(INSTALLPATH)/e6dl
run:
2019-03-14 03:16:40 +08:00
@- go run main.go