Commit 35497bd8 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Fix multiple launches of ASN1SCC when -j is used for Python A mapper.

parent 6bcf3b24
...@@ -131,6 +131,8 @@ def OnStartup(unused_modelingLanguage: str, asnFile: str, outputDir: str, badTyp ...@@ -131,6 +131,8 @@ def OnStartup(unused_modelingLanguage: str, asnFile: str, outputDir: str, badTyp
# mono_exe = "mono " if sys.platform.startswith('linux') else "" # mono_exe = "mono " if sys.platform.startswith('linux') else ""
mono_exe = "mono" mono_exe = "mono"
makefile_text = '''\ makefile_text = '''\
export MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
ASN1SCC:=$(shell which asn1.exe) ASN1SCC:=$(shell which asn1.exe)
ASN2DATAMODEL:=asn2dataModel ASN2DATAMODEL:=asn2dataModel
GRAMMAR := %(origGrammarBase)s GRAMMAR := %(origGrammarBase)s
...@@ -144,10 +146,27 @@ $(BDIR)/$(GRAMMAR)_getset.c: $(GRAMMAR).asn ...@@ -144,10 +146,27 @@ $(BDIR)/$(GRAMMAR)_getset.c: $(GRAMMAR).asn
%(tab)smkdir -p $(BDIR) %(tab)smkdir -p $(BDIR)
%(tab)s$(ASN2DATAMODEL) -toPython -o $(BDIR) $< %(tab)s$(ASN2DATAMODEL) -toPython -o $(BDIR) $<
$(BDIR)/asn1crt.c $(BDIR)/$(GRAMMAR).c $(BDIR)/asn1crt_encoding.c $(BDIR)/asn1crt_encoding_uper.c $(BDIR)/asn1crt_encoding_acn.c $(BDIR)/$(GRAMMAR).h $(BDIR)/asn1crt.h: $(GRAMMAR).asn # Create the ACN file if it is missing
%(tab)sif [ ! -f "$(GRAMMAR).acn" ] ; then %(mono)s $(ASN1SCC) -ACND -o $(BDIR) $< ; fi $(BDIR)/$(GRAMMAR).acn:
%(tab)mono $(ASN1SCC) -ACND -o $(BDIR) $(GRAMMAR).asn
# The hell of multiple outputs (see https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html )
$(BDIR)/asn1crt.c: $(GRAMMAR).asn $(GRAMMAR).acn
%(tab)s%(mono)s $(ASN1SCC) -ACN -c -uPER -equal -o $(BDIR) $< $(GRAMMAR).acn %(tab)s%(mono)s $(ASN1SCC) -ACN -c -uPER -equal -o $(BDIR) $< $(GRAMMAR).acn
# The hell of multiple outputs (see https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html )
$(BDIR)/$(GRAMMAR).c $(BDIR)/asn1crt_encoding.c $(BDIR)/asn1crt_encoding_uper.c $(BDIR)/asn1crt_encoding_acn.c $(BDIR)/$(GRAMMAR).h $(BDIR)/asn1crt.h: $(BDIR)/asn1crt.c
## Recover from the removal of any of these
%(tab)s@for i in $@; do \
%(tab)s if test -f "$$i" ; then :; \
%(tab)s else \
%(tab)s%(tab)srm -f $< ; \
%(tab)s%(tab)s$(MAKE) $< ; \
%(tab)s fi ; \
%(tab)sdone
$(BDIR)/$(GRAMMAR).c $(BDIR)/asn1crt_encoding.c $(BDIR)/asn1crt_encoding_uper.c $(BDIR)/asn1crt_encoding_acn.c $(BDIR)/$(GRAMMAR).h $(BDIR)/asn1crt.h:
$(BDIR)/DV.py: $(GRAMMAR).asn $(BDIR)/$(GRAMMAR).h $(BDIR)/DV.py: $(GRAMMAR).asn $(BDIR)/$(GRAMMAR).h
%(tab)sgrep 'REQUIRED_BYTES_FOR_.*ENCODING' $(BDIR)/$(GRAMMAR).h | awk '{print $$2 " = " $$3}' > $@ %(tab)sgrep 'REQUIRED_BYTES_FOR_.*ENCODING' $(BDIR)/$(GRAMMAR).h | awk '{print $$2 " = " $$3}' > $@
%(tab)spython learn_CHOICE_enums.py %(base)s >> $@ || rm $@ %(tab)spython learn_CHOICE_enums.py %(base)s >> $@ || rm $@
......
...@@ -11,7 +11,7 @@ from setuptools import setup, find_packages ...@@ -11,7 +11,7 @@ from setuptools import setup, find_packages
setup( setup(
name='dmt', name='dmt',
version="2.1.39", version="2.1.40",
packages=find_packages(), packages=find_packages(),
author='Thanassis Tsiodras', author='Thanassis Tsiodras',
author_email='Thanassis.Tsiodras@esa.int', author_email='Thanassis.Tsiodras@esa.int',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment