yangfeng@sbuild:~/makefile/test1$ cat test.c
#include"test.h"
#include"test1.h"
#include"test2.h"
yangfeng@sbuild:~/makefile/test1$ cat test.h
#ifdef android
void printf_android(void)
{
printf("android\n");
}
#endif
yangfeng@sbuild:~/makefile/test1$ cat test1.h
#ifdef android1
void printf_android1(void)
{
printf("android1\n");
}
#endif
yangfeng@sbuild:~/makefile/test1$ cat test/test2.h
#ifdef android2
void printf_android2(void)
{
printf("android2\n");
}
#endif
yangfeng@sbuild:~/makefile/test1$ gcc -E test.c>tt
test.c:3: fatal error: test2.h: No such file or directory
compilation terminated.
yangfeng@sbuild:~/makefile/test1$ gcc -E -I./test test.c>tt
yangfeng@sbuild:~/makefile/test1$ cat tt
# 1 "test.c"
# 1 ""
# 1 ""
# 1 "test.c"
# 1 "test.h" 1
# 2 "test.c" 2
# 1 "test1.h" 1
# 3 "test.c" 2
# 1 "./test/test2.h" 1
# 3 "test.c" 2
yangfeng@sbuild:~/makefile/test1$ gcc -E -Dandroid -I./test test.c>tt
yangfeng@sbuild:~/makefile/test1$ cat tt
# 1 "test.c"
# 1 ""
# 1 ""
# 1 "test.c"
# 1 "test.h" 1
void printf_android(void)
{
printf("android\n");
}
# 2 "test.c" 2
# 1 "test1.h" 1
# 3 "test.c" 2
# 1 "./test/test2.h" 1
# 3 "test.c" 2
yangfeng@sbuild:~/makefile/test1$ gcc -E -Dandroid -Dandroid1 -Dandroid2 -I./test test.c>tt
yangfeng@sbuild:~/makefile/test1$ cat tt
# 1 "test.c"
# 1 ""
# 1 ""
# 1 "test.c"
# 1 "test.h" 1
void printf_android(void)
{
printf("android\n");
}
# 2 "test.c" 2
# 1 "test1.h" 1
void printf_android1(void)
{
printf("android1\n");
}
# 3 "test.c" 2
# 1 "./test/test2.h" 1
void printf_android2(void)
{
printf("android2\n");
}
# 3 "test.c" 2
阅读(4653) | 评论(0) | 转发(0) |