ttcn3_makefilegen with TPD files for hello world project [message #1848046] |
Thu, 18 November 2021 07:19  |
Eclipse User |
|
|
|
Dear community,
I was able to compile and run the hello_world project (https://gitlab.eclipse.org/eclipse/titan/titan.core/-/tree/master/hello) with installed version of titan. For that I used the following command:
ttcn3_makefilegen -l -f *.ttcn *.c* -e myExample && make
For the reasons of not having all compiled cc and binary files in the same folder as the source, I thought about using a tpd file for generating the makefile which allows to push all generated files go to bin/. The current folder structure looks like that:
├── hello_world.tpd
├── MyExample2.cfg
├── MyExample.cfg
├── README.md
└── src
├── hello_world.ttcn
├── MyExample.ttcn
├── PCOType.cc
└── PCOType.hh
The current tpd file looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<TITAN_Project_File_Information version="1.0">
<ProjectName>Hello_world</ProjectName>
<Folders>
<FolderResource projectRelativePath="src" relativeURI="src"/>
</Folders>
<Files>
<FileResource projectRelativePath="src/PCOType.cc" relativeURI="src/PCOType.cc"/>
<FileResource projectRelativePath="src/PCOType.hh" relativeURI="src/PCOType.hh"/>
<FileResource projectRelativePath="src/hello_world.ttcn" relativeURI="src/hello_world.ttcn"/>
<FileResource projectRelativePath="src/MyExample.ttcn" relativeURI="src/MyExample.ttcn"/>
</Files>
<ActiveConfiguration>Default</ActiveConfiguration>
<Configurations>
<Configuration name="Default">
<ProjectProperties>
<MakefileSettings>
<generateInternalMakefile>true</generateInternalMakefile>
<GNUMake>true</GNUMake>
<incrementalDependencyRefresh>true</incrementalDependencyRefresh>
<targetExecutable>bin/MyExample</targetExecutable>
</MakefileSettings>
<LocalBuildSettings>
<workingDirectory>bin</workingDirectory>
</LocalBuildSettings>
</ProjectProperties>
</Configuration>
</Configurations>
</TITAN_Project_File_Information>
However, when I generate the makefile with ttcn3_makefilegen -f -l -d -t hello_world.tpd I'm not successful as ttcn3_makefilegen does not find the ttcn models in the tpd files. See the following output:
ttcn3_makefilegen -f -l -d -t hello_world.tpd
TPD file `hello_world.tpd' validated successfully with schema file `/usr/local/TTCNv3/etc/xsd/TPD.xsd'
Working directory `bin' in project `/home/dr/ttcn3_projects/hello' does not exist, trying to create it...
Working directory created
ttcn3_makefilegen: warning: No source files were given for the Makefile
Data used for Makefile generation:
TTCN-3 project name: Hello_world
TTCN-3 modules: (0 pcs.)
TTCN-3 preprocessing: no
All local TTCN-3 modules follow the naming convention: yes
ASN.1 modules: (0 pcs.)
All local ASN.1 modules follow the naming convention: yes
User C/C++ modules: (0 pcs.)
All local C/C++ header files follow the naming convention: yes
All local C/C++ source files follow the naming convention: yes
Other files: (1 pcs.)
File name: Makefile
Use pre-compiled files from central storage: no
Working directory: /home/dr/ttcn3_projects/hello/bin
GNU make: yes
Execution mode: parallel
Name of executable: MyExample
Output file: Makefile
Force overwrite: yes
Use function test runtime: no
Use dynamic linking: yes
Code splitting mode: <unknown>
Code coverage file: <unknown>
Generating Makefile skeleton...
Makefile skeleton was generated.
Question/ Issue: How do I flag the ttcn modules correctly in the tpd file? Is there any other good way to avoid generating cc and binaries to the same folder than the source, particularity when projects grow?
Thanks for your help,
David
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03571 seconds