Filter C++ through a perl script? -
I have a Perl script, which I would normally show GCC processes before filtering the CCP / H files - Basically an additional preprocessing step is there an easy way to do this? I realize that I can feed the CPP files on the script and the GCC has read the output from stdin, but it does not help header files.
The classic way of handling such process is to source code as a new language with a new file suffix (Input in the Perl filter). After this, you can tell make
how to compile the C ++ source file with this new file type with the Perl script.
For example:
- New suffix:
.ccp
-
New rule (value
.cc
suffix):ccp.cc: $ {FILTERSCRIPT} $ & lt;
-
Add a new suffix to the suffix list - with the preference of general C ++ rules.
The last thing is most difficult if you simply add the .ccp
suffix to the list, then create
actually < Code> .ccp file will ignore the changes in the .cc
file that exists, you must either remove the intermediate .cc
file or make sure that Appears in the .ccp
suffix list before .cc
. (Note: If you write the rule ' .ccp.o
' without '' ' .ccp.cc
' and do not ensure that ' CC < / Code> 'The intermediate has been cleaned, then reconstruction after a compilation failure can mean that
create
only compiles the' .cc
file, which Depressive may be misleading.)
If changing the suffix is not an option, write a compile script which filters and directly dials the C ++ compiler The literacy.
Comments
Post a Comment