Skip to content

Commit

Permalink
Merge pull request #3 from PDXostc/reorg
Browse files Browse the repository at this point in the history
Reorganize code and modify makefile
  • Loading branch information
jack-sanchez authored Aug 15, 2019
2 parents d305fdf + c6cd3b0 commit f493aa6
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ dkms.conf

# Python
__pycache__/
*_swig.py
*.c
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#
# Makefile to generate python interface code for DSTC
#
.PHONY: all clean

CFLAGS += -ggdb
DSTC_DIR ?= /usr/local/
dstc_swig_wrap.o: dstc_swig_wrap.c
python3 setup.py build_ext --inplace -I${DSTC_DIR}/include
INC_DIRS ?= -I/usr/local/

dstc_swig_wrap.c: dstc_swig.i
swig -I${DSTC_DIR}/include -python -includeall dstc_swig.i
OBJ = ./src/dstc_swig_wrap.o
SRC = ./src/dstc_swig_wrap.c
SWIG = ./src/dstc_swig.i

$(OBJ): $(SRC)
python3 setup.py build_ext --inplace $(INC_DIRS)

$(SRC): $(SWIG)
swig $(INC_DIRS) -python -includeall $(SWIG)

clean:
rm -rf _dstc*.so build dstc_swig.py dstc_swig_wrap.* __pycache__ \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
description = """SWIG wrapper for DSTC.""",
py_modules = [ 'dstc', 'dstc_swig' ],
ext_modules = [
Extension('_dstc_swig', sources=['dstc_swig_wrap.c',],libraries=['dstc', 'rmc'])
Extension('_dstc_swig', sources=['./src/dstc_swig_wrap.c',],libraries=['dstc', 'rmc'])
],
)
File renamed without changes.
File renamed without changes.

0 comments on commit f493aa6

Please sign in to comment.