网站做项目,网站分成几种类型,广告制作公司怎么跑业务,怎样提升网站权重一. 用户空间 因为实际上进行预处理的只是Gcc工具#xff0c;而make工具只是一个解决依赖关系的工具。所以问题就简化成如何通过make向gcc传递参数。通过简单的例子来说明#xff1a;hello.c#include stdio.h void main(void) {#ifdef DEBUG printf(y…
一. 用户空间 因为实际上进行预处理的只是Gcc工具而make工具只是一个解决依赖关系的工具。所以问题就简化成如何通过make向gcc传递参数。通过简单的例子来说明hello.c#include stdio.h void main(void) {#ifdef DEBUG printf(you ask for debug!\n);#endif printf(we must say goodbye\n); return;} Makefile:ifeq ($(DEBUG),y)CFLAGS : $(CFLAGS) -DDEBUGendif hello: hello.c$(CC) $(CFLAGS) $ -o $ 执行过程[villelocalhost test]$ lshello.c Makefile[villelocalhost test]$ makecc hello.c -o hello[villelocalhost test]$ ./hello we must say goodbye[villelocalhost test]$ rm hello[villelocalhost test]$ lshello.c Makefile[villelocalhost test]$ make DEBUG:ycc -DDEBUG hello.c -o hello[villelocalhost test]$ ./helloyou ask for debug!we must say goodbye[villelocalhost test]$ 通过以上的简单例子说明如何通过宏开关进行条件编译。