Skip to content
Open
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
112 changes: 112 additions & 0 deletions bin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
KAZOO?=kazoo
SPACECREATOR?=spacecreator.AppImage

# Here you can specify custom compiler/linker flags, and add folders containing
# external code you want to compile and link for a specific partition.
# Use upper case for the partition name:
#
# export <PARTITIONNAME>_USER_CFLAGS=...
# export <PARTITIONNAME>_USER_LDFLAGS=...
# export <PARTITIONNAME>_EXTERNAL_SOURCE_PATH=

# If you need to reset this Makefile to its original state, run:
# $ space-creator reset

# Get the list of ASN.1 files from Space Creator project file:
DISTFILES=$(shell qmake bbbb/cccc.pro -o /tmp/null 2>&1)
ASN1_FILES=$(shell find ${DISTFILES} 2>/dev/null | egrep '\.asn$$|\.asn1$$')

all: release

release: work/glue_release
rm -rf work/glue_debug
rm -rf work/glue_coverage
$(MAKE) -C work check_targets
$(MAKE) -C work

debug: work/glue_debug
rm -rf work/glue_release
rm -rf work/glue_coverage
$(MAKE) -C work check_targets
$(MAKE) -C work

coverage: work/glue_coverage
rm -rf work/glue_release
rm -rf work/glue_debug
$(MAKE) -C work check_targets
$(MAKE) -C work

# To build and run the system type e.g. 'make debug run'
run:
$(MAKE) -C work run

# To run Cheddar/Marzhin for scheduling analysis, type 'make edit_cv'
edit_cv:
$(MAKE) -C work run_cv

# Simulation target (experimental - for systems made of SDL functions only)
simu:
$(MAKE) interfaceview work/glue_simu
$(MAKE) -C work
$(MAKE) -C work/simulation -f Makefile.Simulation simu

skeletons:
$(MAKE) work/skeletons_built

work/skeletons_built: InterfaceView.aadl DataView.aadl
$(KAZOO) --gw -o work
$(MAKE) -C work dataview
touch $@

work/glue_simu: InterfaceView.aadl DataView.aadl
$(KAZOO) -t SIMU --glue --gw
$(MAKE) -C work dataview
touch $@

work/glue_release: InterfaceView.aadl DeploymentView.aadl DataView.aadl
sed -i 's/CoverageEnabled => true/CoverageEnabled => false/g' DeploymentView.aadl || :
$(KAZOO) -p --glue --gw -o work
touch $@

work/glue_debug: InterfaceView.aadl DeploymentView.aadl DataView.aadl
sed -i 's/CoverageEnabled => true/CoverageEnabled => false/g' DeploymentView.aadl || :
$(KAZOO) --debug -p --glue --gw -o work
touch $@

work/glue_coverage: InterfaceView.aadl DeploymentView.aadl DataView.aadl
sed -i 's/CoverageEnabled => false/CoverageEnabled => true/g' DeploymentView.aadl || :
$(KAZOO) --debug -p --glue --gw -o work
touch $@

InterfaceView.aadl: interfaceview.xml
$(SPACECREATOR) --aadlconverter -o $^ -t $(shell taste-config --prefix)/share/xml2aadl/interfaceview.tmplt -x $@

%: %.dv.xml Default_Deployment.aadl
# Build using deployment view $^
@# We must update the .aadl only if the dv.xml file has changed (more recent timestamp)
if [ $< -nt [email protected] ]; then $(SPACECREATOR) --dvconverter -o $< -t $(shell taste-config --prefix)/share/dv2aadl/deploymentview.tmplt -x [email protected]; fi;
rsync --checksum [email protected] DeploymentView.aadl

interfaceview: Default_Deployment.aadl
# Build when no deployment view is open - use default
rsync --checksum $< DeploymentView.aadl

Default_Deployment.aadl: interfaceview.xml
# Create/update a default deployment view for Linux target, if none other is provided
$(SPACECREATOR) --aadlconverter -o $^ -t $(shell taste-config --prefix)/share/xml2dv/interfaceview.tmplt -x $@ || exit 1
rsync --checksum $@ DeploymentView.aadl

DeploymentView.aadl: Default_Deployment.aadl

DataView.aadl: ${ASN1_FILES}
taste-update-data-view $^

clean:
rm -rf work/build work/dataview work/glue_simu
rm -f *.aadl # Interface and Deployment views in AADL are generated
rm -f work/glue_release work/glue_debug work/glue_coverage work/skeletons_built
find work -type d -name "wrappers" -exec rm -rf {} + || :
find work -type d -name "*_GUI" -exec rm -rf {} + || :

.PHONY: clean release debug coverage skeletons simu run

2 changes: 2 additions & 0 deletions bin/esrocos_build_project
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from os import walk
ESROCOS_YAML = "esrocos.yml"
ROOT_DIR = os.environ['AUTOPROJ_CURRENT_ROOT']


project_name = ""

# READ ESROCOS YAML
Expand All @@ -31,6 +32,7 @@ except KeyError:

print("DONE")


os.system("cd model;make")

print("DONE")
Expand Down
37 changes: 37 additions & 0 deletions bin/esrocos_build_project_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python3
import yaml
import sys
from subprocess import call
import os
from os import walk

ESROCOS_YAML = "esrocos.yml"
ROOT_DIR = os.environ['AUTOPROJ_CURRENT_ROOT']

project_name = ""

# READ ESROCOS YAML

print("read esrocos.yml...", end=" ")

data = []

try:
with open(ESROCOS_YAML, 'r') as infile:

data = yaml.load(infile, yaml.FullLoader)
project_name = data["PROJECT_NAME"]

except IOError:
print("could not read esrocos.yml, aborting...")
sys.exit()
except KeyError:
print("error parsing esrocos.yml, aborting...")
sys.exit()

print("DONE")

os.system("cd model;make")

print("DONE")

1 change: 0 additions & 1 deletion bin/esrocos_create_project
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import sys
import os

os.system("cd ${AUTOPROJ_CURRENT_ROOT}/tools/workflow/python;./generate_new_model.py")

#FINALLY
Expand Down
17 changes: 17 additions & 0 deletions bin/esrocos_create_project_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3

import sys
import os

os.system("cd ${AUTOPROJ_CURRENT_ROOT}/tools/workflow/python;./generate_new_model.py")

#FINALLY
print("""
ESROCOS project initialized successfully.
Edit dependencies in >>manifest.xml
Fetch Dependencies with >>esrocos_fetch_dependencies<<.
Then edit the project by calling >>esrocos_edit_project<<.
Generate code stubs with >>esrocos_generate_skeletons<<.
Build the model >>esrocos_build_project<<
Build the project with >>amake<<.
""")
5 changes: 3 additions & 2 deletions bin/esrocos_edit_project
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ESROCOS_YAML = "esrocos.yml"
PROJECT_NAME = ""



try:
print("opening esrocos.yml...\t\t", end=" ")
with open(ESROCOS_YAML, 'r') as stream:
Expand All @@ -34,4 +33,6 @@ except IOError as err:
print("esrocos.yml file not found, please use esrocos-init-project to initialize the project first")
sys.exit()

os.system('cd model;taste-edit-project')


os.system('cd model;space-creator')
37 changes: 37 additions & 0 deletions bin/esrocos_edit_project_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python3

import yaml
import sys
import os
import subprocess
from os import walk
from subprocess import call

ESROCOS_YAML = "esrocos.yml"

PROJECT_NAME = ""



try:
print("opening esrocos.yml...\t\t", end=" ")
with open(ESROCOS_YAML, 'r') as stream:
try:
print("DONE")
print("parsing esrocos.yml...\t\t", end=" ")
sys.stdout.flush()

data = yaml.load(stream, yaml.FullLoader)

project_name = data["PROJECT_NAME"]

print("DONE")
except yaml.YAMLError as err:
print("\nesrocos.yml could not be parsed.")
sys.exit()
except IOError as err:
print("FAILED")
print("esrocos.yml file not found, please use esrocos-init-project to initialize the project first")
sys.exit()

os.system('cd model;taste-edit-project')
2 changes: 1 addition & 1 deletion bin/esrocos_fetch_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ except KeyError as err:


package = ET.Element("package")

os.chdir("..")
if deps:
for dep in deps:
print(dep)
Expand Down
68 changes: 68 additions & 0 deletions bin/esrocos_fetch_dependencies_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env python3
import yaml
import sys
import os
import xml.etree.cElementTree as ET
from subprocess import call
from os import walk
from shutil import copyfile
import re


ESROCOS_YAML = "esrocos.yml"
ROOT_DIR = os.environ['AUTOPROJ_CURRENT_ROOT']
#SHARED_TYPES_DIR = ROOT_DIR+"/install/types/"

project_name = ""
SRC_DIR = ""

# READ YAML

print("read esrocos.yml...\t\t\t", end=" ")

data = []

try:
with open(ESROCOS_YAML, 'r') as infile:
data = yaml.load(infile, yaml.FullLoader)
component_name = data["COMPONENT_NAME"]
project_name =data["PROJECT_NAME"]

except IOError:
print("could not read esrocos.yml, aborting...")
sys.exit()
except KeyError:
print("error parsing esrocos.yml, aborting...")
sys.exit()

print("DONE")

# EXTRACT DEPS

try:
deps = data['deps']
except KeyError as err:
print("error in reading yml data, aborting...")
sys.exit()


package = ET.Element("package")

if deps:
for dep in deps:
print(dep)
amake_arguments = ["aup", dep]
call(amake_arguments)
else:
print("There are no dependencies ")
exit()

#AMAKE
print("calling amake, installing deps...")



for dep in deps:
amake_arguments = ["amake", dep]
call(amake_arguments)
print("DONE")
41 changes: 41 additions & 0 deletions bin/esrocos_generate_skeletons_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
import yaml
import sys
import subprocess
import os

ESROCOS_YAML = "esrocos.yml"
ROOT_DIR = os.environ['AUTOPROJ_CURRENT_ROOT']

project_name = ""

# READ YAML

print("read esrocos.yml...", end=" ")

data = []

try:
with open(ESROCOS_YAML, 'r') as infile:

data = yaml.load(infile, yaml.FullLoader)
project_name = data["PROJECT_NAME"]
component_name = data["COMPONENT_NAME"]

except IOError:
print("could not read esrocos.yml, aborting...")
sys.exit()
except KeyError:
print("error parsing esrocos.yml, aborting...")
sys.exit()

print("DONE")

print(project_name)

out_dir = os.getenv('AUTOPROJ_CURRENT_ROOT')

out_dir = os.path.join(out_dir, component_name, 'model')
print(out_dir)
os.system("cd model;make skeletons")

Loading