Skip to content

Commit

Permalink
Add make targets for compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Lou Marvin Caraig <[email protected]>
  • Loading branch information
se7entyse7en committed Jun 27, 2020
1 parent 978b39d commit 4300f14
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
TWINE_CONFIG_FILE ?= .pypirc

clean:
clean-compile:
rm -f bin/pydockenv_exec*
clean-build:
rm -rf dist
check:
flake8 --config .flake8
isort -rc -c $(git ls-tree -r HEAD --name-only | grep "\.py")
build: clean check
python setup.py sdist bdist_wheel

compile-linux-i686: GOOS = linux
compile-linux-i686: GOARCH = 386
compile-linux-x86_64: GOOS = linux
compile-linux-x86_64: GOARCH = amd64
compile-darwin: GOOS = darwin
compile-darwin: GOARCH = amd64
compile-linux-i686 compile-linux-x86_64 compile-darwin: clean-compile
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o bin/pydockenv_exec_$(GOOS)_$(GOARCH)

compile-all: compile-linux-i686 compile-linux-x86_64 compile-darwin

build-linux-i686: PLAT_NAME = manylinux1_i686
build-linux-i686: EXEC_SUFFIX = _linux_386
build-linux-i686: compile-linux-i686
build-linux-x86_64: PLAT_NAME = manylinux1_x86_64
build-linux-x86_64: EXEC_SUFFIX = _linux_amd64
build-linux-x86_64: compile-linux-x86_64
build-darwin: PLAT_NAME = macosx_10_4_x86_64
build-darwin: EXEC_SUFFIX = _darwin_amd64
build-darwin: compile-darwin
build-linux-i686 build-linux-x86_64 build-darwin: clean-build
mv bin/pydockenv_exec{$(EXEC_SUFFIX),}
python setup.py bdist_wheel --plat-name $(PLAT_NAME)
rm bin/pydockenv_exec

build-all: build-linux-i686 build-linux-x86_64 build-darwin

publish-check:
@if [[ $$(git rev-parse --abbrev-ref HEAD) != "master" ]]; then \
echo "error: not in master"; \
Expand All @@ -25,10 +54,10 @@ publish-pypi:
twine check dist/*
twine upload --config-file $(TWINE_CONFIG_FILE) --repository $(PYPI_REPOSITORY) dist/*

publish-test: PYPI_REPOSITORY=testpypi
publish-test: build publish-pypi
publish: PYPI_REPOSITORY=pypi
publish: build publish-check publish-pypi
publish-test: PYPI_REPOSITORY = testpypi
publish-test: build-all publish-pypi
publish: PYPI_REPOSITORY = pypi
publish: build-all publish-check publish-pypi
git push origin --tags

bump-major: PART = major
Expand All @@ -38,4 +67,7 @@ bump-patch: PART = patch
bump-major bump-minor bump-patch:
bumpversion $(PART)

.PHONY: clean check build publish-check publish bump-major bump-minor bump-patch
.PHONY: clean-compile clean-build check build \
compile-linux-i686 compile-linux-x86_64 compile-darwin compile-all \
build-linux-i686 build-linux-x86_64 build-darwin build-all \
publish-check publish bump-major bump-minor bump-patch

0 comments on commit 4300f14

Please sign in to comment.