-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move python specific into PY subdirectories
Change logic to provide both python2 and python3 in PYTHON variable. If set to empty, nothing is built. If set to specific, only that is built. Simplify logic. Makes a bit uglier error reports when something fails.
- Loading branch information
Showing
3 changed files
with
68 additions
and
20 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
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,32 @@ | ||
SWIG = swig | ||
PYTHON ?= python3 | ||
|
||
ifeq ($(DESTDIR),) | ||
PYBUILDARGS = | ||
PYINSTALLARGS = | ||
else | ||
PYBUILDARGS = --include-dirs=$(DESTDIR)$(includedir) --library-dirs=$(DESTDIR)$(libdir) | ||
PYINSTALLARGS = --root=$(DESTDIR) | ||
endif | ||
|
||
all: build-python | ||
|
||
build-python: lgpio.i | ||
@if type -p $(SWIG) >&/dev/null; then \ | ||
$(SWIG) -python lgpio.i; \ | ||
$(PYTHON) setup.py build_ext $(PYBUILDARGS); \ | ||
else \ | ||
echo "*** need swig package to install lgpio.py ***"; \ | ||
fi | ||
|
||
lgpio_wrap.c: build-python | ||
|
||
install-python: | ||
@if type -p $(SWIG) >&/dev/null; then \ | ||
$(PYTHON) setup.py -q install $(PYINSTALLARGS); \ | ||
fi | ||
|
||
install: install-python | ||
|
||
clean: | ||
rm -f lgpio_wrap.c |
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,17 @@ | ||
PYTHON ?= python3 | ||
|
||
ifeq ($(DESTDIR),) | ||
PYINSTALLARGS = | ||
else | ||
PYINSTALLARGS = --root=$(DESTDIR) | ||
endif | ||
|
||
all: build-python | ||
|
||
build-python: | ||
@$(PYTHON) setup.py build | ||
|
||
install-python: build-python | ||
@$(PYTHON) setup.py -q install $(PYINSTALLARGS) | ||
|
||
install: install-python |