Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1882 | clevermous | 1 | #include |
2 | #include |
||
3 | #ifndef WEXITSTATUS |
||
4 | #include |
||
5 | #endif |
||
6 | |||
7 | char buf[32768]; |
||
8 | |||
9 | #if (HAS_DEVENV == 0) |
||
10 | char * __dev_env; |
||
11 | #endif |
||
12 | |||
13 | static void __env(void) |
||
14 | { |
||
15 | char * p=getenv("MENUETDEV"); |
||
16 | if(!p) |
||
17 | { |
||
18 | printf("MENUETDEV system variable not set !!!\n"); |
||
19 | exit(-1); |
||
20 | } |
||
21 | #if (HAS_DEVENV == 0) |
||
22 | __dev_env=p; |
||
23 | #endif |
||
24 | } |
||
25 | |||
26 | int main(int argc,char * argv[]) |
||
27 | { |
||
28 | int u; |
||
29 | __env(); |
||
30 | if(argc<2) |
||
31 | { |
||
32 | fprintf(stderr,"Usage: %s file1.c file2.s ...\n",argv[0]); |
||
33 | return 1; |
||
34 | } |
||
35 | #if (HAS_DEVENV == 0) |
||
36 | sprintf(buf,"gcc -nostdinc -I%s/include -D__DEV_CONFIG_H=\"<%s/config.h>\" -M ",__dev_env,__dev_env); |
||
37 | #else |
||
38 | sprintf(buf,"gcc -nostdinc -I/dev/env/MENUETDEV/include -D__DEV_CONFIG_H='\"/dev/env/MENUETDEV/config.h\"' -M "); |
||
39 | #endif |
||
40 | for(u=1;u |
||
41 | { |
||
42 | strcat(buf,argv[u]); |
||
43 | strcat(buf," "); |
||
44 | } |
||
45 | return WEXITSTATUS(system(buf)); |
||
46 | } |