Skip to content

Commit

Permalink
[swig] refs fibercrypto#133 Make initial refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevMac committed May 5, 2019
1 parent ff67436 commit be739bb
Show file tree
Hide file tree
Showing 58 changed files with 1,508 additions and 30,118 deletions.
36 changes: 19 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin
SKYBUILD_DIR = $(SKYCOIN_DIR)/build
BUILDLIBC_DIR = $(SKYBUILD_DIR)/libskycoin
LIBC_DIR = $(SKYCOIN_DIR)/lib/cgo
LIBSWIG_DIR = swig
LIBSWIG_DIR = lib/swig/swig
LIBSWIG_PYSKYCOIN = lib/swig
BUILD_DIR = build
DIST_DIR = dist
BIN_DIR = $(SKYCOIN_DIR)/bin
Expand Down Expand Up @@ -42,9 +43,9 @@ $(BUILDLIBC_DIR)/libskycoin.a: $(LIB_FILES) $(SRC_FILES) $(HEADER_FILES)
rm -f $(BUILDLIBC_DIR)/libskycoin.a
GOPATH="$(GOPATH_DIR)" make -C $(SKYCOIN_DIR) build-libc-static
ls $(BUILDLIBC_DIR)
rm -f swig/include/libskycoin.h
mkdir -p swig/include
grep -v _Complex $(INCLUDE_DIR)/libskycoin.h > swig/include/libskycoin.h
rm -f $(LIBSWIG_PYSKYCOIN)/swig/include/libskycoin.h
mkdir -p $(LIBSWIG_PYSKYCOIN)/swig/include
grep -v _Complex $(INCLUDE_DIR)/libskycoin.h > $(LIBSWIG_PYSKYCOIN)/swig/include/libskycoin.h

build-libc: configure $(BUILDLIBC_DIR)/libskycoin.a ## Build libskycoin C client library

Expand All @@ -60,36 +61,37 @@ build-swig: ## Generate Python C module from SWIG interfaces
sed -i 's/#/%/g' $(LIBSWIG_DIR)/structs.i ;\
fi \
}
rm -f ./skycoin/skycoin.py
rm -f swig/pyskycoin_wrap.c
rm -f swig/include/swig.h
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h swig/include/
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i
rm -f .$(LIBSWIG_PYSKYCOIN)/skycoin/skycoin.py
rm -f $(LIBSWIG_PYSKYCOIN)/swig/pyskycoin_wrap.c
rm -f $(LIBSWIG_PYSKYCOIN)/swig/include/swig.h
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h $(LIBSWIG_PYSKYCOIN)/swig/include/
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir .$(LIBSWIG_PYSKYCOIN)/skycoin/ -o $(LIBSWIG_PYSKYCOIN)/swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i

develop: ## Install PySkycoin for development
$(PYTHON) setup.py develop
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py develop)
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py develop) \
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py develop)

build-libc-swig: build-libc build-swig

build: build-libc-swig ## Build PySkycoin Python package
$(PYTHON) setup.py build
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py build)
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py build)

test-ci: ## Run tests on (Travis) CI build
tox
# (cd $(LIBSWIG_PYSKYCOIN) && tox)
(cd $(PYTHON_CLIENT_DIR) && tox)


test: build-libc build-swig develop ## Run project test suite
$(PYTHON) setup.py test
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py test)
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py test) \
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py test)

sdist: ## Create source distribution archive
$(PYTHON) setup.py sdist --formats=gztar
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py sdist --formats=gztar) \
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py sdist --formats=gztar)

bdist_wheel: ## Create architecture-specific binary wheel distribution archive
$(PYTHON) setup.py bdist_wheel
(cd $(LIBSWIG_PYSKYCOIN) && $(PYTHON) setup.py bdist_wheel)/
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py bdist_wheel)

# FIXME: After libskycoin 32-bits binaries add bdist_manylinux_i686
Expand Down
2 changes: 1 addition & 1 deletion gopath/src/github.com/skycoin/skycoin
Submodule skycoin updated 758 files
File renamed without changes.
Empty file added lib/swig/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit be739bb

Please sign in to comment.