Discussion:
[Scons-users] include dir with scons variant_dir handling
Hua Yanghao
2018-07-12 08:06:09 UTC
Permalink
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.

This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?

Thanks for any tips before I dive into the source code.

Best Regards,
Yanghao Hua
Bill Deegan
2018-07-12 12:26:21 UTC
Permalink
so you're using SConscript('src/SConscript',variant_dir='build') for
example?
You shouldn't need to do anything to make this work with any builder.

-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Hua Yanghao
2018-07-12 14:00:28 UTC
Permalink
Hi Bill,
Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".

Any idea?

Best Regards,
Yanghao
so you're using SConscript('src/SConscript',variant_dir='build') for example?
You shouldn't need to do anything to make this work with any builder.
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Hua Yanghao
2018-07-12 14:05:26 UTC
Permalink
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH,
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'

So I guess I need to generate and use this _CPPINCFLAGS in my builder
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
so you're using SConscript('src/SConscript',variant_dir='build') for example?
You shouldn't need to do anything to make this work with any builder.
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Hua Yanghao
2018-07-12 14:22:17 UTC
Permalink
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.

any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH,
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my builder
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
so you're using SConscript('src/SConscript',variant_dir='build') for example?
You shouldn't need to do anything to make this work with any builder.
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Hua Yanghao
2018-07-12 14:44:30 UTC
Permalink
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.

Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH,
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my builder
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
so you're using SConscript('src/SConscript',variant_dir='build') for example?
You shouldn't need to do anything to make this work with any builder.
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-07-12 15:06:41 UTC
Permalink
Which HDL are you using? Verilog or VHDL?
What's the include syntax?
(It's been a while..)

You should probably create HDLINCFLAGS and user $_concat with your own
INCPREFIX... etc.
Take a look at: https://scons.org/doc/production/HTML/scons-man.html and
search for _concat

-Bill
Post by Hua Yanghao
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.
Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH,
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my builder
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript",
variant_dir="build"),
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
On Thu, Jul 12, 2018 at 2:31 PM Bill Deegan <
Post by Bill Deegan
so you're using SConscript('src/SConscript',variant_dir='build')
for example?
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
You shouldn't need to do anything to make this work with any
builder.
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica
of the
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I
guess
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include
path
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in
the
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Hua Yanghao
2018-07-13 08:36:19 UTC
Permalink
Both. for VCS it is something like "+incdir+path/to/include", however
this is not my issue.

I can use _concat() and INCPREFIX to have the right format of include,
but the included files won't be copied into the build folder.

I believe this is done in C scanner, need to dig a bit more.
Post by Bill Deegan
Which HDL are you using? Verilog or VHDL?
What's the include syntax?
(It's been a while..)
You should probably create HDLINCFLAGS and user $_concat with your own INCPREFIX... etc.
Take a look at: https://scons.org/doc/production/HTML/scons-man.html and search for _concat
-Bill
Post by Hua Yanghao
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.
Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH,
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my builder
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
and apparently the CPPPATH is only taken care in my C code build, not
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
so you're using SConscript('src/SConscript',variant_dir='build') for example?
You shouldn't need to do anything to make this work with any builder.
-Bill
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a replica of the
original file, e.g. duplicate=1 by default) output in a separate
folder.
This works out of box for C include files, which also have a nice
duplicate in the output directory (I am not using scanners so I guess
all C include files are duplicated). However now I am enabling new
customized builders, which also have a similar concept of include path
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated in the
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-07-13 12:52:45 UTC
Permalink
Hua,

Yes the scanners purpose is to scan source files and find includes and add
them the the DAG.
So you'd need a scanner for verilog and one for VHDL.
The current scanners are mainly just REGEX's pulling out the include
statements.

See: https://scons.org/doc/production/HTML/scons-user/ch21.html for an
example
Also: https://github.com/SCons/scons/wiki/ToolsForFools

Those should both point you in the right direction

-Bill
Post by Hua Yanghao
Both. for VCS it is something like "+incdir+path/to/include", however
this is not my issue.
I can use _concat() and INCPREFIX to have the right format of include,
but the included files won't be copied into the build folder.
I believe this is done in C scanner, need to dig a bit more.
Post by Bill Deegan
Which HDL are you using? Verilog or VHDL?
What's the include syntax?
(It's been a while..)
You should probably create HDLINCFLAGS and user $_concat with your own
INCPREFIX... etc.
Post by Bill Deegan
Take a look at: https://scons.org/doc/production/HTML/scons-man.html
and search for _concat
Post by Bill Deegan
-Bill
Post by Hua Yanghao
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.
Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX,
CPPPATH,
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my
builder
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript",
variant_dir="build"),
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and apparently the CPPPATH is only taken care in my C code build,
not
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
On Thu, Jul 12, 2018 at 2:31 PM Bill Deegan <
Post by Bill Deegan
so you're using SConscript('src/SConscript',variant_dir='build')
for example?
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
You shouldn't need to do anything to make this work with any
builder.
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
-Bill
On Thu, Jul 12, 2018 at 4:06 AM, Hua Yanghao <
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a
replica of the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
original file, e.g. duplicate=1 by default) output in a
separate
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
folder.
This works out of box for C include files, which also have a
nice
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
duplicate in the output directory (I am not using scanners so
I guess
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
all C include files are duplicated). However now I am enabling
new
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
customized builders, which also have a similar concept of
include path
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated
in the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Brian Cody
2018-07-13 12:56:17 UTC
Permalink
Hua,

I have a VHDL scanner, might want to collab a bit. I could use a system
verilog scanner.

-Brian

On Jul 13, 2018 at 08:52, <Bill Deegan <***@baddogconsulting.com>> wrote:

Hua,

Yes the scanners purpose is to scan source files and find includes and add
them the the DAG.
So you'd need a scanner for verilog and one for VHDL.
The current scanners are mainly just REGEX's pulling out the include
statements.

See: https://scons.org/doc/production/HTML/scons-user/ch21.html for an
example
Also: https://github.com/SCons/scons/wiki/ToolsForFools

Those should both point you in the right direction

-Bill
Post by Hua Yanghao
Both. for VCS it is something like "+incdir+path/to/include", however
this is not my issue.
I can use _concat() and INCPREFIX to have the right format of include,
but the included files won't be copied into the build folder.
I believe this is done in C scanner, need to dig a bit more.
Post by Bill Deegan
Which HDL are you using? Verilog or VHDL?
What's the include syntax?
(It's been a while..)
You should probably create HDLINCFLAGS and user $_concat with your own
INCPREFIX... etc.
Post by Bill Deegan
Take a look at: https://scons.org/doc/production/HTML/scons-man.html
and search for _concat
Post by Bill Deegan
-Bill
Post by Hua Yanghao
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.
Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX,
CPPPATH,
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my
builder
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript",
variant_dir="build"),
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and apparently the CPPPATH is only taken care in my C code build,
not
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH", and
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
On Thu, Jul 12, 2018 at 2:31 PM Bill Deegan <
Post by Bill Deegan
so you're using SConscript('src/SConscript',variant_dir='build')
for example?
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
You shouldn't need to do anything to make this work with any
builder.
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
-Bill
On Thu, Jul 12, 2018 at 4:06 AM, Hua Yanghao <
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a
replica of the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
original file, e.g. duplicate=1 by default) output in a
separate
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
folder.
This works out of box for C include files, which also have a
nice
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
duplicate in the output directory (I am not using scanners so
I guess
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
all C include files are duplicated). However now I am enabling
new
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
customized builders, which also have a similar concept of
include path
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files dupliated
in the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________ Scons-users mailing list
Scons-***@scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-07-13 13:19:54 UTC
Permalink
Brian,

Any chance you could contribute it via the scons-contrib repo?

-Bill
Post by Brian Cody
Hua,
I have a VHDL scanner, might want to collab a bit. I could use a system
verilog scanner.
-Brian
Hua,
Yes the scanners purpose is to scan source files and find includes and add
them the the DAG.
So you'd need a scanner for verilog and one for VHDL.
The current scanners are mainly just REGEX's pulling out the include
statements.
See: https://scons.org/doc/production/HTML/scons-user/ch21.html for an
example
Also: https://github.com/SCons/scons/wiki/ToolsForFools
Those should both point you in the right direction
-Bill
Post by Hua Yanghao
Both. for VCS it is something like "+incdir+path/to/include", however
this is not my issue.
I can use _concat() and INCPREFIX to have the right format of include,
but the included files won't be copied into the build folder.
I believe this is done in C scanner, need to dig a bit more.
Post by Bill Deegan
Which HDL are you using? Verilog or VHDL?
What's the include syntax?
(It's been a while..)
You should probably create HDLINCFLAGS and user $_concat with your own
INCPREFIX... etc.
Post by Bill Deegan
Take a look at: https://scons.org/doc/production/HTML/scons-man.html
and search for _concat
Post by Bill Deegan
-Bill
Post by Hua Yanghao
After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.
Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
Post by Hua Yanghao
This works as to expand CPPPATH into a list of path however this is
not taking care of copying include files into build directory.
any idea?
Post by Hua Yanghao
This is the magic? '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX,
CPPPATH,
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
So I guess I need to generate and use this _CPPINCFLAGS in my
builder
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and define my own INCPREFIX/SUFFIX and it should do? Will give it a
try quickly.
Post by Hua Yanghao
Hi Bill,
Yes, I am using SConscript("path/to/SConscript",
variant_dir="build"),
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
and apparently the CPPPATH is only taken care in my C code
build, not
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
for my HDL builds.
And I even want something like "INCPATH" instead of "CPPPATH",
and
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
generates not "-Ipath/to/my/include" but also other formats e.g.
"+incdir+path/to/my/include".
Any idea?
Best Regards,
Yanghao
On Thu, Jul 12, 2018 at 2:31 PM Bill Deegan <
Post by Bill Deegan
so you're using SConscript('src/SConscript',variant_dir='build')
for example?
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
You shouldn't need to do anything to make this work with any
builder.
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
-Bill
On Thu, Jul 12, 2018 at 4:06 AM, Hua Yanghao <
Post by Hua Yanghao
Dear Scons Users and Developers,
I am using scons variant_dir so all builds (including a
replica of the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
original file, e.g. duplicate=1 by default) output in a
separate
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
folder.
This works out of box for C include files, which also have a
nice
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
duplicate in the output directory (I am not using scanners so
I guess
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
all C include files are duplicated). However now I am
enabling new
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
customized builders, which also have a similar concept of
include path
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
and include files, how can I achieve the same as for C code
compilation, e.g. to have include path and its files
dupliated in the
Post by Bill Deegan
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Hua Yanghao
Post by Bill Deegan
Post by Hua Yanghao
output folder?
Thanks for any tips before I dive into the source code.
Best Regards,
Yanghao Hua
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________ Scons-users mailing list
mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...