Commit bfb195fd authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Generate Makefile to build the properties

parent 9e477bef
......@@ -4,14 +4,12 @@ install:
@pip install --user --upgrade .
clean:
@rm -rf build dist *.egg-info properties/*.pyc
make -C test -f Makefile.properties clean || :
rm -f test/Makefile.properties
rm -f properties/*.pyc
test:
properties/properties.py -s ../test/properties test/*.pr
cd test && asn1.exe -Ada dataview-uniq.asn -typePrefix asn1Scc -equal && gnatmake -gnat2012 -c orchestrator_stop_conditions.adb
cd test && gnatbind -n -Lliborechestrator_stop_conditions orchestrator_stop_conditions
cd test && gnatmake -c -gnat2012 b~orchestrator_stop_conditions.adb
cd test && gcc -shared -fPIC -o liborchestrator_stop_conditions.so b~orchestrator_stop_conditions.o orchestrator_stop_conditions.o taste_basictypes.o adaasn1rtl.o -lgnat
make -C test -f Makefile.properties build
.PHONY: all install clean test
This directory contains the code for the TASTE Property Parser and code generator
Install by typing, as root:
Install by typing:
$ make install
This command will call: python setup.py install --record
You can install in a virtualenv instead
You must first install opengeode, which is a required dependency
(c) European Space Agency, 2015
Test your setup with:
$ make test
(c) European Space Agency, 2016
Author: Maxime Perrotin
......@@ -7,14 +7,16 @@ Parse expressions such as:
and generate code to verify the property
This shall be used in combination with the OpenGEODE simulator
(c) European Space Agency, 2015-2016
Author: Maxime.Perrotin@esa.int
'''
__author__ = "Maxime Perrotin"
__license__ = "ESA Community (compatible with LGPLv3)"
__version__ = "1.0.1"
__license__ = "LGPL v3"
__version__ = "1.0.2"
__url__ = "http://taste.tuxfamily.org"
import os
......@@ -35,6 +37,21 @@ console = logging.StreamHandler(sys.__stdout__)
console.setFormatter(ColorFormatter())
log.addHandler(console)
MAKEFILE_TEMPLATE = '''all: build
clean:
@rm -rf *.o *.ad? *.ali bin examiner *.idx *_simu.sh *_interface.aadl *.wrn *.gpr gnat.cfg runSpark.sh lib{name}.so
build:
asn1.exe -Ada {asn1} -typePrefix asn1Scc -equal
gnatmake -gnat2012 -c {name}.adb
gnatbind -n -Llib{name} {name}
gnatmake -c -gnat2012 b~{name}.adb
gcc -shared -fPIC -o lib{name}.so b~{name}.o {name}.o {modules} adaasn1rtl.o -lgnat
.PHONY: all clean build
'''
def parse_input_files(pr_files, ppty_file):
''' Invoke opengeode to parse the SDL models and use the expression
......@@ -105,6 +122,15 @@ def parse_input_files(pr_files, ppty_file):
idx += 1
opengeode.AdaGenerator.generate(process, simu=True)
# gather asn.1 files and modules
asn1_files = ' '.join(ast[0].asn1_filenames) #'dataview-uniq.asn'
asn1_modules = ' '.join(name.lower().replace('-', '_') + '.o'
for name in ast[0].asn1Modules)
with open('Makefile.properties', 'w') as Makefile:
Makefile.write(MAKEFILE_TEMPLATE.format(name=process.processName,
asn1=asn1_files,
modules=asn1_modules))
def cli():
''' Application entry point, when used from the command line '''
......
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