gqinvs 发表于 2016-11-22 02:14:39

Makefile中的宏定义必须采用 $(CC)和 $(CFLAGS)么?

  磨砺技术珠矶,践行数据之道,追求卓越价值
  回到上一级页面: PostgreSQL杂记页   回到顶级页面:PostgreSQL索引页
  
  如题:
  In particular, the macro CC is the C compiler to use, and CFLAGS is the list of flags to pass to the compilation command.
  验证如下,Makefile原有内容
  CC=gcc
CFLAGS=-I.

hellomake: hellomake.o hellofunc.o
     $(CC) -o hellomake hellomake.o hellofunc.o $(CFLAGS)
  改为:
  AA=gcc
BB=-I.
hellomake: hellomake.o hellofunc.o
  $(AA) -o hellomake hellomake.o hellofunc.o $(BB)
  
  再执行make命令,毫无问题。
  
  回到上一级页面: PostgreSQL杂记页   回到顶级页面:PostgreSQL索引页
  磨砺技术珠矶,践行数据之道,追求卓越价值
页: [1]
查看完整版本: Makefile中的宏定义必须采用 $(CC)和 $(CFLAGS)么?