Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ help:
@echo " html to make all HTML language docs"
@echo " pdf to make SBP LaTeX datasheet"
@echo " python to make Python bindings"
@echo " pythonNG to make Python (JIT) bindings"
@echo " python-jit to make Python (JIT) bindings"
@echo " haskell to make Haskell bindings"
@echo " java to make Java bindings"
@echo " rust to make Rust bindings"
Expand All @@ -65,15 +65,16 @@ help:
@echo " quicktype-elm generate Elm module from JSON Schema"
@echo

all: c python pythonNG javascript java docs haskell protobuf rust jsonschema
all: c python javascript java docs haskell protobuf rust jsonschema
clean:
@echo "Removing the ./c/build directory..."
rm -r $(SWIFTNAV_ROOT)/c/build
docs: verify-prereq-docs pdf html

c: deps-c gen-c test-c
python: deps-python gen-python test-python
pythonNG: deps-python gen-pythonNG
c: deps-c gen-c test-c
python-nojit: deps-python gen-python-nojit
python-jit: deps-python gen-python-jit
python: python-nojit python-jit test-python
javascript: deps-javascript gen-javascript test-javascript
java: deps-java gen-java test-java
haskell: deps-haskell gen-haskell test-haskell
Expand Down Expand Up @@ -175,7 +176,7 @@ gen-c:

$(call announce-end,"Finished generating C. Please check $(SWIFTNAV_ROOT)/c/include/libsbp.")

gen-python:
gen-python-nojit:
$(call announce-begin,"Generating Python bindings")
cd $(SWIFTNAV_ROOT)/generator; \
$(SBP_GEN_BIN) -i $(SBP_SPEC_DIR) \
Expand All @@ -184,13 +185,13 @@ gen-python:
--python
$(call announce-end,"Finished generating Python bindings. Please check $(SWIFTNAV_ROOT)/python/sbp")

gen-pythonNG:
gen-python-jit:
$(call announce-begin,"Generating Python bindings")
cd $(SWIFTNAV_ROOT)/generator; \
$(SBP_GEN_BIN) -i $(SBP_SPEC_DIR) \
-o $(SWIFTNAV_ROOT)/python/sbp/jit \
-r $(SBP_MAJOR_VERSION).$(SBP_MINOR_VERSION).$(SBP_PATCH_VERSION) \
--pythonNG
--python_jit
$(call announce-end,"Finished generating Python bindings. Please check $(SWIFTNAV_ROOT)/python/sbp")

gen-javascript:
Expand Down
12 changes: 6 additions & 6 deletions generator/sbpg/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def get_args():
parser.add_argument('--python',
action="store_true",
help='Target language: Python.')
parser.add_argument('--pythonNG',
parser.add_argument('--python_jit',
action="store_true",
help='Target language: Python.')
help='Target language: Python (JIT).')
parser.add_argument('--javascript',
action="store_true",
help='Target language: JavaScript.')
Expand Down Expand Up @@ -84,7 +84,7 @@ def main():
# Parse and validate arguments.
args = get_args().parse_args()
verbose = args.verbose
assert args.jsonschema or args.pythonNG or args.python or args.javascript or args.c or args.test_c or args.haskell or args.latex or args.protobuf or args.java or args.rust or args.test_rust, \
assert args.jsonschema or args.python_jit or args.python or args.javascript or args.c or args.test_c or args.haskell or args.latex or args.protobuf or args.java or args.rust or args.test_rust, \
"Please specify a target language."
input_file = os.path.abspath(args.input_file[0])
assert len(args.input_file) == 1
Expand Down Expand Up @@ -128,9 +128,9 @@ def main():
if args.python:
import sbpg.targets.python as py
py.render_source(output_dir, parsed)
if args.pythonNG:
import sbpg.targets.pythonNG as pyNG
pyNG.render_source(output_dir, parsed)
if args.python_jit:
import sbpg.targets.pythonNG as py_jit
py_jit.render_source(output_dir, parsed)
elif args.javascript:
import sbpg.targets.javascript as js
js.render_source(output_dir, parsed)
Expand Down
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def _read_release_version():

def read_release_version():
major, minor, patch = _read_release_version().split('.')
return (int(major), int(minor), int(patch))
return (int(major), int(minor), patch)


MAJOR, MINOR, PATCH = read_release_version()
IS_RELEASED = os.environ.get('IS_RELEASED', '') != ''

VERSION = '%d.%d.%d' % (MAJOR, MINOR, PATCH)
VERSION = '%d.%d.%s' % (MAJOR, MINOR, PATCH)

VERSION_PY_TEMPLATE = """\
# THIS FILE IS GENERATED FROM TRAITS SETUP.PY
Expand Down