Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
e1dc0a8e
Commit
e1dc0a8e
authored
Feb 02, 2021
by
ASN.1 Documenter
Browse files
Merge branch 'cygwin' of
https://forge.etsi.org/rep/ITS/ITS
into cygwin
parents
6ce80906
160b5af0
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
76 additions
and
536 deletions
+76
-536
Makefile
Makefile
+5
-2
README.md
README.md
+13
-7
ccsrc/EncDec/module.mk
ccsrc/EncDec/module.mk
+1
-0
ccsrc/Ports/LibIts_ports/Rtcmem_ports/AdapterControlPort_Rtcmem.hh
...ts/LibIts_ports/Rtcmem_ports/AdapterControlPort_Rtcmem.hh
+0
-2
ccsrc/Ports/LibIts_ports/Rtcmem_ports/UpperTesterPort_Rtcmem.hh
...Ports/LibIts_ports/Rtcmem_ports/UpperTesterPort_Rtcmem.hh
+3
-0
ccsrc/Ports/LibIts_ports/Rtcmem_ports/module.mk
ccsrc/Ports/LibIts_ports/Rtcmem_ports/module.mk
+1
-1
ccsrc/Ports/LibIts_ports/UpperTesterPort.hh
ccsrc/Ports/LibIts_ports/UpperTesterPort.hh
+36
-2
ccsrc/Protocols/IVIM/module.mk
ccsrc/Protocols/IVIM/module.mk
+1
-1
ccsrc/Protocols/Rtcmem/module.mk
ccsrc/Protocols/Rtcmem/module.mk
+3
-0
ccsrc/Protocols/UpperTester/UpperTesterRtcmemCodec.cc
ccsrc/Protocols/UpperTester/UpperTesterRtcmemCodec.cc
+0
-3
ccsrc/Protocols/UpperTester/UpperTesterRtcmemLayer.cc
ccsrc/Protocols/UpperTester/UpperTesterRtcmemLayer.cc
+2
-1
ccsrc/Protocols/UpperTester/module.mk
ccsrc/Protocols/UpperTester/module.mk
+4
-0
config.mk
config.mk
+1
-1
docker/Dockerfile.stfubuntu
docker/Dockerfile.stfubuntu
+1
-0
docker/home/etc/init.d/40-ttf002.sh
docker/home/etc/init.d/40-ttf002.sh
+0
-4
docker/home/etc/init.d/50-ats.sh
docker/home/etc/init.d/50-ats.sh
+3
-6
etc/AtsMapemSpatem/AtsMapemSpatem.cfg
etc/AtsMapemSpatem/AtsMapemSpatem.cfg
+1
-1
etc/AtsRSUsSimulator/AtsRSUSimulator.cfg
etc/AtsRSUsSimulator/AtsRSUSimulator.cfg
+1
-1
scripts/autointerop_generate_makefile.bash
scripts/autointerop_generate_makefile.bash
+0
-251
scripts/btp_generate_makefile.bash
scripts/btp_generate_makefile.bash
+0
-253
No files found.
Makefile
View file @
e1dc0a8e
...
...
@@ -49,7 +49,10 @@ bindir := $(TOPDIR)/bin
sources
:=
$(
sort
$(all_sources)
)
includes
:=
$(outdir)
$(outdir)
/..
$(outdir)
/../asn1
$(all_includes)
$(NPCAP_INCLUDE)
EXE
=
.exe
ifeq
(Windows_NT,$(OS))
EXE
=
.exe
endif
ttcn_sources
:=
$(
filter
%.ttcn ,
$(sources)
)
ttcn3_sources
:=
$(
filter
%.ttcn3,
$(sources)
)
asn_sources
:=
$(
filter
%.asn,
$(sources)
)
...
...
@@ -115,7 +118,7 @@ $(cc_objects) : $(outdir)/%.o : %.cc
$(gen_sources)
:
$(outdir)/.generate
$(outdir)/.generate
:
Makefile $(tt_sources)
$(TTCN3_DIR)
/bin/compiler
-
n
-e
-L
-R
-U
none
-o
$(outdir)
$(tt_sources)
$(TTCN3_DIR)
/bin/compiler
-
d
-e
-f
-g
-l
-L
-R
-U
none
-x
-X
-o
$(outdir)
$(tt_sources)
touch
$@
$(bindir)/libItsAsn.so
:
$(outdir)/asn1/libItsAsn.so
...
...
README.md
View file @
e1dc0a8e
...
...
@@ -170,6 +170,7 @@ Procedure:
libpcap-dev
libgcrypt-dev
libncurses5-dev
libjsoncpp-dev
libssl-dev
libtool-bin
libtool
...
...
@@ -208,7 +209,7 @@ Procedure:
-
Clone the ETSI ITS protocols project into $HOME/dev folder
```
sh
$
git clone
$
git clone
git clone
--recurse-submodules
-b
TTF0002_Its
--single-branch
https://forge.etsi.org/gitlab/ITS/ITS.git ./TTF0002_Its
```
-
Update your default environment with the content of the script $HOME/dev/TTF0002_Its/scripts/devenv.bash.ubuntu
...
...
@@ -249,11 +250,15 @@ Pre-requisites:
-
Your are logged as 'etsi' or 'vagrant' user
-
Procedure using TITAN command line (only):
-
Open several SSH session (PuTTY...)
-
Change to the directory ~/dev/TTF0002_Its/src/AtsCAM/objs
-
Change to the directory ~/dev/TTF0002_Its/
-
Modify the file config.mk according to your system:
-
On Linux, comment all the lines using the '#' character
-
On Windows, update the path accordingly
-
Build the test suite AtsCAM using the following command:
```
sh
$
../bin/cam_generate_makefile.bash
$
export
ATS
=
AtsCAM
# The Abstract Test Suite you wnat to build, such as AtsDENM, AtsSecurity...
$
make
...
```
...
...
@@ -264,11 +269,12 @@ $ ../bin/cam_generate_makefile.bash
-
To run the test suitem, execute the following command:
```
sh
$
../bin/run-all.bash
$
cd
~/dev/TTF0002_Its/scripts
$
../run_all.bash
...
```
-
The log files are located in ../logs
folder
. You can edit them using any editor or using the Eclipse TITAN log plugins
-
The log files are located in ../logs
/AtsCAM folder for this example
. You can edit them using any editor or using the Eclipse TITAN log plugins
## How to generate ITS test certificates
...
...
@@ -291,8 +297,8 @@ To build the tool, run the 'make' command in each of the following folders:
After applying the previous clause, change to the folder '~/dev/TTF0002_Its/data/v3' and execute 'make' command:
```
cd ~/dev/TTF0002_Its/data/v3
make
$
cd ~/dev/TTF0002_Its/data/v3
$
make
```
The certificates will be located in the folder '~/dev/TTF0002_Its/data/v3/certificates'.
...
...
ccsrc/EncDec/module.mk
View file @
e1dc0a8e
...
...
@@ -28,6 +28,7 @@ sources += \
LibItsHttp_Encdec.cc
\
LibItsMapemSpatem_Encdec.cc
\
LibItsSremSsem_Encdec.cc
\
LibItsRtcmem_Encdec.cc
\
LibItsIvim_Encdec.cc
\
LibItsPki_Encdec.cc
...
...
ccsrc/Ports/LibIts_ports/Rtcmem_ports/AdapterControlPort_Rtcmem.hh
View file @
e1dc0a8e
#ifndef AdapterControlPort_Rtcmem_HH
#define AdapterControlPort_Rtcmem_HH
#include "LibItsSremSsem_TestSystem.hh"
//=============================================================================
#include "LibItsRtcmem_TestSystem.hh"
...
...
ccsrc/Ports/LibIts_ports/Rtcmem_ports/UpperTesterPort_Rtcmem.hh
View file @
e1dc0a8e
#ifndef UpperTesterPort_Rtcmem_HH
#define UpperTesterPort_Rtcmem_HH
#include "layer.hh"
#include "params.hh"
//=============================================================================
#include "LibItsRtcmem_TestSystem.hh"
namespace
LibItsRtcmem__TestSystem
{
...
...
ccsrc/Ports/LibIts_ports/Rtcmem_ports/module.mk
100755 → 100644
View file @
e1dc0a8e
sources
:=
AdapterControlPort_Rtcmem.cc
AdapterControlPort_Rtcmem.hh RtcmemPort.cc RtcmemPort.hh UpperTesterPort_Rtcmem.cc UpperTesterPort_Rtcmem.hh
sources
:=
AdapterControlPort_Rtcmem.cc
RtcmemPort.cc UpperTesterPort_Rtcmem.cc
includes
:=
.
ccsrc/Ports/LibIts_ports/UpperTesterPort.hh
View file @
e1dc0a8e
...
...
@@ -47,6 +47,12 @@
#include "SremSsem_ports/UpperTesterPort_SremSsem.hh"
#endif
#ifdef AtsIVIM
#include "GN_ports/UpperTesterPort_GN.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "IVIM_ports/UpperTesterPort_IVIM.hh"
#endif
#ifdef AtsMapemSpatem
#include "GN_ports/UpperTesterPort_GN.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
...
...
@@ -59,6 +65,17 @@
#include "Rtcmem_ports/UpperTesterPort_Rtcmem.hh"
#endif
#ifdef AtsRSUsSimulator // This is not an Abstract Test Suit, but an helper tool to simulate basic RSU/OBU functionalities
#include "GN_ports/UpperTesterPort_GN.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "IVIM_ports/UpperTesterPort_IVIM.hh"
#include "MapemSpatem_ports/UpperTesterPort_MapemSpatem.hh"
#include "SremSsem_ports/UpperTesterPort_SremSsem.hh"
#include "Rtcmem_ports/UpperTesterPort_Rtcmem.hh"
#endif
#else //_NO_SOFTLINKS_
#ifdef AtsGeoNetworking
...
...
@@ -96,10 +113,10 @@
#include "UpperTesterPort_DENM.hh"
#endif
#ifdef Ats
SremSsem
#ifdef Ats
IVIM
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_
SremSsem
.hh"
#include "UpperTesterPort_
IVIM
.hh"
#endif
#ifdef AtsMapemSpatem
...
...
@@ -108,12 +125,29 @@
#include "UpperTesterPort_MapemSpatem.hh"
#endif
#ifdef AtsSremSsem
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_SremSsem.hh"
#endif
#ifdef AtsRtcmem
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_Rtcmem.hh"
#endif
#ifdef AtsRSUsSimulator // This is not an Abstract Test Suit, but an helper tool to simulate basic RSU/OBU functionalities
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_CAM.hh"
#include "UpperTesterPort_DENM.hh"
#include "UpperTesterPort_IVIM.hh"
#include "UpperTesterPort_MapemSpatem.hh"
#include "UpperTesterPort_SremSsem.hh"
#include "UpperTesterPort_Rtcmem.hh"
#endif
#endif//_NO_SOFTLINKS_
#endif
ccsrc/Protocols/IVIM/module.mk
View file @
e1dc0a8e
sources
:=
ivim_codec.cc ivim_layer.cc ivim_pdu_codec.cc
sources
:=
ivim_codec.cc ivim_layer.cc ivim_pdu_codec.cc
includes
:=
.
ccsrc/Protocols/Rtcmem/module.mk
0 → 100644
View file @
e1dc0a8e
sources
:=
RtcmemCodec.cc RtcmemLayer.cc
includes
:=
.
ccsrc/Protocols/UpperTester/UpperTesterRtcmemCodec.cc
View file @
e1dc0a8e
...
...
@@ -4,10 +4,7 @@
#include "UpperTesterRtcmemCodec.hh"
#include "loggers.hh"
#include "uppertester_types.hh"
#include "RtcmemCodec.hh"
#include "SsemCodec.hh"
template
<
typename
T_type
>
class
OPTIONAL
;
class
TTCN_EncDec
;
...
...
ccsrc/Protocols/UpperTester/UpperTesterRtcmemLayer.cc
View file @
e1dc0a8e
#include "UpperTesterRtcmemFactory.hh"
#include "uppertester_types.hh"
#include "LibItsRtcmem_TypesAndValues.hh"
#include "LibItsRtcmem_TestSystem.hh"
#include "loggers.hh"
...
...
ccsrc/Protocols/UpperTester/module.mk
View file @
e1dc0a8e
...
...
@@ -19,6 +19,9 @@ endif
ifeq
(AtsSremSsem, $(ATS))
sources
+=
UpperTesterSremSsemCodec.cc UpperTesterSremSsemLayer.cc
endif
ifeq
(AtsRtcmem, $(ATS))
sources
+=
UpperTesterRtcmemCodec.cc UpperTesterRtcmemLayer.cc
endif
ifeq
(AtsDENM, $(ATS))
sources
+=
uppertester_denm_codec.cc uppertester_denm_layer.cc
endif
...
...
@@ -35,6 +38,7 @@ sources += uppertester_cam_codec.cc uppertester_cam_layer.cc \
uppertester_ivim_codec.cc uppertester_ivim_layer.cc
\
UpperTesterSremSsemCodec.cc UpperTesterSremSsemLayer.cc
\
uppertester_mapem_spatem_codec.cc uppertester_mapem_spatem_layer.cc
\
UpperTesterRtcmemCodec.cc UpperTesterRtcmemLayer.cc
\
uppertester_pki_codec.cc uppertester_pki_layer.cc
\
endif
...
...
config.mk
100755 → 100644
View file @
e1dc0a8e
TTCN3_DIR
:
= /cygdrive/c/Tools/Titan
WPCAP_DLL_PATH
:=
/cygdrive/c/windows/system32/npcap/wpcap.dll
WPCAP_DLL_PATH
:=
/cygdrive/c/windows/system32/npcap/wpcap.dll
NPCAP_INCLUDE
:=
/cygdrive/c/PROGRA~1/Npcap/sdk/include
docker/Dockerfile.stfubuntu
View file @
e1dc0a8e
...
...
@@ -37,6 +37,7 @@ RUN echo "docker-STF-dev" > /etc/hostname \
libffi-dev \
libglib2.0-dev \
libgcrypt-dev \
libjsoncpp-dev \
libncurses5-dev \
libpcap-dev \
libqt5svg5-dev \
...
...
docker/home/etc/init.d/40-ttf002.sh
View file @
e1dc0a8e
...
...
@@ -21,10 +21,6 @@ cd ${HOME}/dev/Workspace/TTF0002
ln
-s
../../TTF0002_Its/testdata
ln
-s
../../TTF0002_Its/data
echo
-e
"*****************************
\n
* Make ASN.1 sources
\n
*****************************
\n
"
cd
${
HOME
}
/dev/Workspace/TTF0002/bin/asn1
make
-f
../../../../TTF0002_Its/asn1/Makefile
echo
-e
"*****************************
\n
* Make Certificate generator
\n
*****************************
\n
"
# make V3 certificate generators
cd
${
HOME
}
/dev/TTF0002_Its/tools/itscertgen/asn1certgen
...
...
docker/home/etc/init.d/50-ats.sh
View file @
e1dc0a8e
...
...
@@ -8,17 +8,14 @@ echo -e "*****************************\n* Change user in cfg files\n************
cd
${
HOME
}
/dev/TTF0002_Its/scripts
||
exit
1
./update_user_name.sh
||
exit
1
echo
-e
"*****************************
\n
* Install test suites
\n
*****************************
\n
"
./update_its_project.bash
||
exit
1
echo
-e
"*****************************
\n
* Build test suites
\n
*****************************
\n
"
cd
${
HOME
}
/dev/
etsi_its/src
cd
${
HOME
}
/dev/
TTF0002_Its
ATS_LIST
=
"AtsCAM AtsDENM AtsGeoNetworking AtsPki AtsSecurity AtsIVIM AtsMapemSpatem AtsSremSsem AtsRtcmem AtsRSUsSimulator"
for
i
in
${
ATS_LIST
}
do
cd
$i
/objs
../bin/
*
_generate_makefile.bash
cd
../..
export
ATS
=
$i
make
done
cd
${
HOME
}
...
...
etc/AtsMapemSpatem/AtsMapemSpatem.cfg
View file @
e1dc0a8e
...
...
@@ -11,7 +11,7 @@ LibItsMapemSpatem_Pics.PICS_IS_IUT_SECURED := false
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
LogFile := "../logs/%e.%h-%r.%s"
LogFile := "../logs/
AtsMapemSpatem/
%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP
...
...
etc/AtsRSUsSimulator/AtsRSUSimulator.cfg
View file @
e1dc0a8e
...
...
@@ -89,7 +89,7 @@ LibItsPki_Pics.PICS_IUT_AA_CERTIFICATE_ID := "CERT_TS_A_AA"
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
LogFile := "../logs/%e.%h-%r.%s"
LogFile := "../logs/
AtsRSUsSimulator/
%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP
...
...
scripts/autointerop_generate_makefile.bash
deleted
100755 → 0
View file @
6ce80906
#!/bin/bash
#set -e
set
-vx
function
f_exit
{
cd
${
CURPWD
}
unset
TTCN_FILES
unset
CC_FILES
unset
CFG_FILES
unset
EXECUTABLE
echo
$1
exit
$2
}
function
f_usage
{
echo
"build.bash: This script import from External Disk the "
echo
"Optional arguments:"
echo
" prof: Generate a makefile including profiling options (e.g. ./build.bash prof)"
exit
0
}
clear
if
[
"
$1
"
==
"help"
]
then
f_usage
fi
ATS_NAME
=
AutoInterop
#CURPWD=`pwd`
if
[
!
"
${
PWD
##*/
}
"
==
"objs"
]
then
cd
../objs
if
[
!
$?
==
0
]
then
echo
"Please move to PROJECT/obj directory"
exit
1
fi
fi
# Remove everything
rm
-fr
../objs/
*
.hh
rm
-fr
../objs/
*
.cc
rm
-fr
../objs/
*
.log
rm
-fr
../objs/
*
.o
rm
-fr
../objs/Makefile
# Remove useless files
find ..
-type
f
-name
"*~"
-exec
rm
{}
\;
find ..
-type
f
-name
"*.bak"
-exec
rm
{}
\;
find ..
-type
f
-name
"*.log"
-exec
rm
{}
\;
# Build XSD files if any and put them in objs directory
if
[
-d
../xsd
]
then
XSD_FILES
=
`
find ../xsd
-name
'*.xsd'
`
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
xsd2ttcn.exe
${
XSD_FILES
}
else
xsd2ttcn
${
XSD_FILES
}
fi
if
[
"
$?
"
!=
"0"
]
then
f_exit
"Failed to generate XSD source code"
2
fi
fi
# Build ASN.1 files if any and put them in objs directory
ASN1_PATH
=
${
PATH_DEV_ITS
}
/ttcn/LibIts/asn1
if
[
-d
${
ASN1_PATH
}
]
then
ASN1_FILES
=
`
find
${
ASN1_PATH
}
-name
'*.asn*'
`
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
asn1_compiler.exe
-e
${
ASN1_FILES
}
else
asn1_compiler
-e
${
ASN1_FILES
}
fi
if
[
"
$?
"
!=
"0"
]
then
f_exit
"Failed to generate ASN.1 source code"
3
fi
fi
REFERENCES
=
"LibCommon LibIts/Common LibIts/BTP LibIts/GeoNetworking LibIts/Ipv6OverGeoNetworking LibIts/Security LibIts/CAM LibIts/DENM LibIts/IVIM LibIts/MapemSpatem LibIts/SremSsem LibIts/Http LibIts/Pki"
for
i
in
${
REFERENCES
}
do
# TTCN code
for
j
in
`
find
${
PATH_DEV_ITS
}
/src/
$i
/ttcn
-type
f
-name
"*.ttcn"
`
;
do
ln
-sf
$j
../ttcn/
`
basename
$j
`
done
# Include source code
files
=
`
find
${
PATH_DEV_ITS
}
/src/
$i
/include
-type
f
`
if
[
"
${
files
}
"
!=
" "
]
then
for
j
in
${
files
}
;
do
ln
-sf
$j
../include/
`
basename
$j
`
done
fi
# CC source code
files
=
`
find
${
PATH_DEV_ITS
}
/src/
$i
/src
-type
f
`
if
[
"
${
files
}
"
!=
" "
]
then
for
j
in
${
files
}
;
do
ln
-sf
$j
../src/
`
basename
$j
`
done
fi
done
# Generate the list of the TTCN-3 files
TTCN_FILES
=
`
find ..
-name
'*.ttcn*'
`
# Start ATS generation - Step 1
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
rm
../bin/
*
.exe ../lib/
*
.dll
compiler.exe
-d
-e
-f
-g
-j
-l
-L
-n
-t
-R
-U
none
-x
-X
${
TTCN_FILES
}
${
ASN1_FILES
}
2>&1 3>&1 |
tee
build.log
if
[
"
$?
"
==
"1"
]
then
f_exit
"Failed to compile ATS"
4
fi
else
compiler
-d
-e
-f
-g
-l
-L
-n
-t
-R
-U
none
-x
-X
${
TTCN_FILES
}
${
ASN1_FILES
}
2>&1 3>&1 |
tee
build.log
if
[
"
$?
"
==
"1"
]
then
f_exit
"Failed to generate ATS source code"
6
fi
fi
# Sart ATS generation - Step 2
# Create working variables
CC_FILES
=
`
find ../src
-name
'*.c*'
`
FWK_FILES
=
`
find
${
PATH_DEV_ITS
}
/framework/
-name
'*.c*'
`
CFG_FILES
=
`
find ../etc
-name
'*.cfg'
`
# Sart ATS generation - Step 3
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
ttcn3_makefilegen.exe
-d
-f
-g
-m
-R
-U
none
-e
Ats
${
ATS_NAME
}
${
TTCN_FILES
}
${
ASN1_FILES
}
${
CC_FILES
}
${
FWK_FILES
}
${
CFG_FILES
}
|
tee
--append
build.log
if
[
"
$?
"
==
"1"
]
then
f_exit
"Failed to compile ATS"
5
fi
else
ttcn3_makefilegen
-d
-f
-g
-m
-R
-U
none
-e
Ats
${
ATS_NAME
}
${
TTCN_FILES
}
${
ASN1_FILES
}
${
CC_FILES
}
${
FWK_FILES
}
${
CFG_FILES
}
|
tee
--append
build.log
if
[
"
$?
"
==
"1"
]
then
f_exit
"Failed to generate ATS source code"
7
fi
fi
# Remove port skeletons to use src/<port skeletons>
for
i
in
`
ls
../include/
*
.hh
`
do
if
[
-f
./
`
basename
$i
`
]
then
rm
./
`
basename
$i
`
fi
done
for
i
in
`
ls
../src/
*
.cc
`
do
if
[
-f
./
`
basename
$i
`
]
then
rm
./
`
basename
$i
`
fi
done
# Check if Makefile was generated
if
[
!
-f
./Makefile
]
then
f_exit
"Failed to generate ATS source code"
8
fi
# Patch ATS generated files
#./bin/patch.bash 2>&1 3>&1 | tee --append build.log
# Add compiler/linker options
if
[
"
$1
"
==
"prof"
]
then
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
CXXFLAGS_DEBUG_MODE
=
's/-Wall/-pg -Wall -std=c++11 -fPIC -D_XOPEN_SOURCE=700 -pthreads -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
# -DASN_DISABLE_OER_SUPPORT
else
CXXFLAGS_DEBUG_MODE
=
's/-Wall/-pg -Wall -std=c++11 -fPIC -pthreads -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
# -DASN_DISABLE_OER_SUPPORT
fi
LDFLAGS_DEBUG_MODE
=
's/LDFLAGS = /LDFLAGS = -pg -pthread -fPIC -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
else
if
[
"
${
OSTYPE
}
"
==
"cygwin"
]
then
CXXFLAGS_DEBUG_MODE
=
's/-Wall/-ggdb -O0 -Wall -std=c++11 -fPIC -D_XOPEN_SOURCE=700 -pthread -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
# -DASN_DISABLE_OER_SUPPORT
else
CXXFLAGS_DEBUG_MODE
=
's/-Wall/-ggdb -O0 -Wall -std=c++11 -fPIC -pthread -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
# -DASN_DISABLE_OER_SUPPORT
fi
LDFLAGS_DEBUG_MODE
=
's/LDFLAGS = /LDFLAGS = -g -pthread -fPIC -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g'
fi
ADD_INCLUDE
=
'/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_ITS)/include -I$(PATH_DEV_ITS)/include/asn1 -I$(PATH_DEV_ITS)/framework/include -I../include -I../../LibIts/Common/include -I../../LibIts/BTP/include -I../../LibIts/CAM/include -I../../LibIts/DENM/include -I$(HOME_INC) -I.'
ADD_LIBRARIES
=
's/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lstdc++fs -lpcap -L$(PATH_DEV_ITS)\/lib -lItsAsn /g'
sed
--in-place
"
${
CXXFLAGS_DEBUG_MODE
}
"
./Makefile
sed
--in-place
"
${
LDFLAGS_DEBUG_MODE
}
"
./Makefile
sed
--in-place
"
${
ADD_INCLUDE
}
"
./Makefile
sed
--in-place
"
${
ADD_LIBRARIES
}
"
./Makefile
# Update COMPILER_FLAGS
COMPILER_FLAGS
=
's/COMPILER_FLAGS = /COMPILER_FLAGS = -e /g'
sed
--in-place
"
${
COMPILER_FLAGS
}
"
./Makefile
# Update clean clause
CLEAN_LINE
=
's/$(RM) $(EXECUTABLE)/$(RM) ..\/bin\/$(EXECUTABLE) ..\/src\/*.o/g'
sed
--in-place
"
${
CLEAN_LINE
}
"
./Makefile
# Move binary file command
EXECUTABLE
=
MyExample
MV_CMD
=
's/all: $(TARGET) ;/all: $(TARGET) ; @if [ -f ..\/objs\/$(EXECUTABLE) ]; then mv ..\/objs\/$(EXECUTABLE) ..\/bin; fi ;/g'
sed
--in-place
"
${
MV_CMD
}
"
./Makefile
# Add run command
ADD_HOST
=
'/PLATFORM = /aHOST=127.0.0.1'
ADD_PORT
=
'/PLATFORM = /aPORT=12000'
sed
--in-place
"
${
ADD_PORT
}
"
./Makefile
sed
--in-place
"
${
ADD_HOST
}
"
./Makefile
ADD_RUN_LINE_1
=
'$arun: all'
ADD_RUN_LINE_2
=
'$a\\t@sudo LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(PWD)/../bin/$(EXECUTABLE) $(HOST) $(PORT)'
sed
--in-place
"
${
ADD_RUN_LINE_1
}
"
./Makefile
sed
--in-place
"
${
ADD_RUN_LINE_2
}
"
./Makefile
ADD_RUN_LINE_1
=
'$arun_d: all'
ADD_RUN_LINE_2
=
'$a\\t@gdb --args $(PWD)/../bin/$(EXECUTABLE) $(HOST) $(PORT)'
sed
--in-place
"
${
ADD_RUN_LINE_1
}
"
./Makefile
sed
--in-place
"
${
ADD_RUN_LINE_2
}
"
./Makefile
ADD_RUN_LINE_1
=
'$arun_v: all'
ADD_RUN_LINE_2
=
'$a\\t@sudo LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) valgrind -v --tool=memcheck --leak-check=yes --show-reachable=yes --track-fds=yes --run-cxx-freeres=yes $(PWD)/../bin/$(EXECUTABLE) $(HOST) $(PORT)'
sed
--in-place
"
${
ADD_RUN_LINE_1
}
"
./Makefile
sed
--in-place
"
${
ADD_RUN_LINE_2
}
"
./Makefile
# Add Doxygen entry
ADD_RUN_LINE_1
=
'$agendoc:'
ADD_RUN_LINE_2
=
'$a\\tdoxygen ../docs/o2.cfg'
sed
--in-place
"
${
ADD_RUN_LINE_1
}
"
./Makefile
sed
--in-place
"
${
ADD_RUN_LINE_2
}
"
./Makefile
# Build all
make all 2>&1 3>&1 |
tee
--append
build.log
if
[
"
$?
"
!=
"0"
]
then
f_exit
"Failed to generate ATS source code"
9
fi
../bin/Ats
${
ATS_NAME
}
-v
if
[
"
$?
"
!=
"0"
]
then
f_exit
"Failed to execute binary file Ats
${
ATS_NAME
}
"
10
fi
f_exit
"Build done successfully"
0
scripts/btp_generate_makefile.bash
deleted
100755 → 0
View file @
6ce80906
#!/bin/bash
#set -e
set
-vx
function
f_exit
{
cd
${
CURPWD
}
unset
TTCN_FILES
unset
CC_FILES
unset
CFG_FILES
unset
EXECUTABLE
echo
$1
exit
$2
}
function
f_usage
{
echo
"build.bash: This script import from External Disk the "
echo
"Optional arguments:"
echo
" prof: Generate a makefile including profiling options (e.g. ./build.bash prof)"
exit
0
}
clear
if
[
"
$1
"
==
"help"
]
then
f_usage
fi
ATS_NAME
=
BTP
#CURPWD=`pwd`
if
[
!
"
${
PWD
##*/
}
"
==
"objs"
]
then
cd
../objs
if
[
!
$?
==
0
]
then
echo
"Please move to PROJECT/obj directory"
exit
1
fi
fi
# Remove everything
rm
-fr
../objs/
*
.hh
rm
-fr
../objs/
*
.cc
rm
-fr
../objs/
*
.log
rm
-fr
../objs/
*
.o
rm
-fr
../objs/Makefile
# Remove useless files
find ..
-type
f
-name
"*~"
-exec
rm
{}
\;
find ..
-type
f
-name
"*.bak"
-exec
rm
{}
\;
find ..
-type
f
-name
"*.log"
-exec
rm
{}
\;
# Build XSD files if any and put them in objs directory
if
[
-d
../xsd
]
then
XSD_FILES
=
`
find ../xsd
-name
'*.xsd'
`