Justin Huang Posted November 5, 2017 Report Share Posted November 5, 2017 (edited) Hi, I'd like to encode the .o/.so buildCommand in IPXACT XML fileSet, such that user can rebuild the .o/.so file from XML. For example, the .o/.so generation command look like this: % g++ -c hello.cpp -o hello.o % g++ hello.o -shared -fPIC -o libhello.so Should I encode XML fileSet like below? <ipxact:fileSet> <ipxact:file> <ipxact:name>hello.cpp</ipxact:name> <ipxact:fileType>cppSource</ipxact:fileType> </ipxact:file> <ipxact:file> <ipxact:name>hello.so</ipxact:name> <ipxact:fileType>swObjectLibrary</ipxact:fileType> <ipxact:buildCommand> <ipxact:command>g++</ipxact:command> <ipxact:flags>hello.o -shared -fPIC -o hello.so</ipxact:flags> <ipxact:targetName>hello.so</ipxact:targetName> </ipxact:buildCommand> <ipxacxt:dependency>hello.o</ipxacxt:dependency> </ipxact:file> <ipxact:file> <ipxact:name>hello.o</ipxact:name> <ipxact:fileType>swObject</ipxact:fileType> <ipxact:buildCommand> <ipxact:command>g++</ipxact:command> <ipxact:flags>-c hello.cpp -o hello.o</ipxact:flags> <ipxact:targetName>hello.o</ipxact:targetName> </ipxact:buildCommand> </ipxact:file> </ipxact:fileSet> Thanks, Justin Edited November 6, 2017 by Justin Huang added <ipxact:dependency> element Quote Link to comment Share on other sites More sharing options...
kock Posted November 6, 2017 Report Share Posted November 6, 2017 Hello Justin, The flags element should not contain the whole command; it should contain the flags only. Also you miss a dependency on hello.cpp for hello.o. I would suggest to describe it like this: <ipxact:fileSet> <ipxact:name>fs-sw</ipxact:name> <ipxact:file> <ipxact:name>hello.cpp</ipxact:name> <ipxact:fileType>cppSource</ipxact:fileType> </ipxact:file> <ipxact:file> <ipxact:name>hello.o</ipxact:name> <ipxact:fileType>swObject</ipxact:fileType> <ipxact:buildCommand> <ipxact:command>g++</ipxact:command> <ipxact:targetName>hello.o</ipxact:targetName> </ipxact:buildCommand> <ipxact:dependency>hello.cpp</ipxact:dependency> </ipxact:file> <ipxact:file> <ipxact:name>hello.so</ipxact:name> <ipxact:fileType>swObjectLibrary</ipxact:fileType> <ipxact:buildCommand> <ipxact:command>g++</ipxact:command> <ipxact:flags>-shared -fPIC</ipxact:flags> <ipxact:targetName>hello.so</ipxact:targetName> </ipxact:buildCommand> <ipxact:dependency>hello.o</ipxact:dependency> </ipxact:file> </ipxact:fileSet> Best regards, Erwin Quote Link to comment Share on other sites More sharing options...
Justin Huang Posted November 6, 2017 Author Report Share Posted November 6, 2017 Hi Erwin, What if we used customized inhouse tool to compile hello.c into hello.s (assembly code) and then generate hello.o from hello.s as shown below. how to describe it in IP-XACT XML? hello.s: hello.c cmd1 flags1 cmd2 flags2 hello.o: hello.s cmd3 flags3 2nd question: if hello.c includes a few headers, e.g., a.h, b.h, ..., should these header files be listed as dependency in IP-XACT XML? Quote Link to comment Share on other sites More sharing options...
kock Posted November 8, 2017 Report Share Posted November 8, 2017 Hi Justin, It is not possible to describe multiple build commands to support cmd1 and cmd1. Command cmd1 will probably generate an intermediate file that is used for command cmd2. I think you have add this intermediate file to the file set and move cmd2 to the build command for that file. For the 2nd question, all header files should be listed explicitly in the file set with isIncludeFile set to true. The dependency must be added to the files that include those files or to the whole file set. Best regards, Erwin Quote Link to comment Share on other sites More sharing options...
Justin Huang Posted November 10, 2017 Author Report Share Posted November 10, 2017 Hi Erwin, Why are the '-c' and '-o' options discarded in the buildCommand section for .o target? If the command to build a target, e.g., tgt.out from input.txt, is ' exe -i input.txt -o a -opta x -optb y -optc z ', where the '-o' option does not mean output, how to map this command to 'ipxact:command, ipxact:flags, and ipxact:targetName, ipxact:dependency'? Does ipxact has assumption that each build command should have -o option which means output, and -c option for dependency? How can I know which option should be remved from ipxact:flags? Thanks, Justin Quote Link to comment Share on other sites More sharing options...
Thien Ooi Posted November 15, 2017 Report Share Posted November 15, 2017 That's because -c and -o are redundant in this particular case of the g++ command. The target is already given by <ipxact:targetname> while the source file is given by <ipxact:file> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.