从makefile设置标志的问题

时间:2015-11-04 08:17:34

标签: c makefile flags

var allPTags = document.getElementsByTagName("p");

if(allPTags.length) { 
  alert(something);
}

生成文件:

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char** argv) {

#ifdef DEBUG
  printf("Debug!\n");
#endif

  printf("hello world\n");

}

当我运行CC=gcc-5 CFLAGS=-I DEPS=foo.c main: $(DEPS) $(CC) -o foo $(DEPS) $(CFLAGS). debug: CFLAGS += -DDEBUG debug: main

make debug

为什么我没有看到“调试!”?

1 个答案:

答案 0 :(得分:3)

-I选项需要一个参数,现在是-DDEBUG.。删除-I选项,或为其提供参数。我建议删除它,因为我没有看到任何保证将目录添加到包含搜索路径的内容。