Makefile, add targets: dist, dist-whl, dist-egg, install, install-prefix, install-sys Release_2.1.0-RC2
authorheck <heck@pep.foundation>
Fri, 18 Sep 2020 03:00:46 +0200
changeset 3964a031fb9a0e3
parent 395 aced546a31e7
child 397 f7f92375cb5e
Makefile, add targets: dist, dist-whl, dist-egg, install, install-prefix, install-sys
Makefile
Makefile.conf
     1.1 --- a/Makefile	Fri Sep 18 02:59:21 2020 +0200
     1.2 +++ b/Makefile	Fri Sep 18 03:00:46 2020 +0200
     1.3 @@ -1,14 +1,41 @@
     1.4  include Makefile.conf
     1.5  
     1.6 -.PHONY: all build clean devenv envtest
     1.7 +.PHONY: all dist dist-egg dist-whl install install-prefix install-sys compile clean devenv envtest
     1.8  
     1.9 -all: build_ext
    1.10 +all: dist
    1.11  
    1.12 -build_ext:
    1.13 -	python3 setup.py build_ext $(BUILD_EXT_OPTS)
    1.14 +# create wheel and egg package in dist/
    1.15 +dist: dist-whl dist-egg
    1.16 +
    1.17 +# create wheel package in dist/
    1.18 +dist-whl: compile
    1.19 +	python3 setup.py bdist_wheel
    1.20 +
    1.21 +# create egg package in dist/
    1.22 +dist-egg: compile
    1.23 +	python3 setup.py bdist_egg
    1.24 +
    1.25 +
    1.26 +# installs the package into the user home
    1.27 +install: compile
    1.28 +	python3 setup.py install --force --user
    1.29 +
    1.30 +# installs the package into PREFIX path
    1.31 +install-prefix: compile
    1.32 +	python3 setup.py install --force $(PREFIX_OPT)
    1.33 +
    1.34 +# installs the package system wide
    1.35 +install-sys: compile
    1.36 +	python3 setup.py install --force
    1.37 +
    1.38 +
    1.39 +# build the module into build/
    1.40 +compile:
    1.41 +	python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT)
    1.42  
    1.43  clean:
    1.44  	rm -r $(BUILD_DIR)
    1.45 +	rm -r $(DIST_DIR)
    1.46  
    1.47  devenv:
    1.48  	LD_LIBRARY_PATH=$(PREFIX)/lib \
     2.1 --- a/Makefile.conf	Fri Sep 18 02:59:21 2020 +0200
     2.2 +++ b/Makefile.conf	Fri Sep 18 03:00:46 2020 +0200
     2.3 @@ -1,15 +1,18 @@
     2.4  HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
     2.5  
     2.6 -# Defaults
     2.7 +# Constants
     2.8 +BUILD_DIR = ./build
     2.9 +DIST_DIR = ./dist
    2.10 +
    2.11 +# Build config Defaults
    2.12  DEBUG=0
    2.13  PREFIX?=$(HOME)
    2.14 -BUILD_DIR = ./build
    2.15  
    2.16  ######### Overrides #########
    2.17  -include $(HERE)local.conf
    2.18  
    2.19  ifeq ($(DEBUG),1)
    2.20 -	BUILD_EXT_OPTS+=--debug
    2.21 +	DEBUG_OPT+=--debug
    2.22  endif
    2.23  
    2.24 -BUILD_EXT_OPTS += --prefix=$(PREFIX)
    2.25 +PREFIX_OPT += --prefix=$(PREFIX)
    2.26 \ No newline at end of file