[Prev][Next][Index]
pC++2dep question
- From: Andrew Mauer <mauer@mcs.anl.gov>
- Date: Mon, 20 Jun 1994 11:23:49 -0500
- To: clliu@alpha.ie.nsysu.edu.tw
- Cc: sage-bugs@cica.indiana.edu
- Subject: pC++2dep question
Your problem is that pC++2dep does not handle preprocessor directives;
it currently needs to have its input already preprocessed. This means
you will have to do something like this.
$ cc -E main.c > main-processed.c
$ pC++2dep main-processed.c
$ ./your-transformation main-processed.proj
You may want to investigate the `*.dep' file with `dumpdep' to see
what information is recorded there. In this case, you can see that the
#includes just disappear.
I have found that one can usually write a customized sed script to
de-include the inlines #includes, for later compilation. It's still
just a hack, but I'd be happy talk about it more if you want.
Good luck.
/Andrew/
> -----------------------------------------------------------------------
> #include <stdio.h>
> #include <stdlib.h>
> main()
> {
> int i,j,k;
> printf("this is a test.\n");
> }
> -------------------------------------------------------------------------
>
>Then I use pC++2dep to parse it in order to generate the .dep file.
>It succeeds, but when I use the "unparse" executable file to unparse
>it. It will generate:
>
>
> -----------------------------------------------------------------------
>
> main()
> {
> int i,j,k;
> printf("this is a test.\n");
> }
> -------------------------------------------------------------------------
>
> Why these two lines ( "#include <stdio.h>" and "#include <stdlib.h>" )
> disappear? These two line are really important to me.
>
> Thanks again.
>
>clliu
>clliu@alpha.ie.nsysu.edu.tw
>
>
>
>