makefile中的块

时间:2015-11-24 14:42:45

标签: makefile

我有简单的makefile:

CC=gcc
CFLAGS=-I.
DEPS = f1.h,hellomake.h



$(info starting makefile )

%.o: %.c $(DEPS)
        $(info executing)
        $(CC) -c -o $@ $< $(CFLAGS)

hellomake: hellomake.o hellofunc.o f1.o 
        gcc -o hellomake hellomake.o hellofunc.o f1.o -I. 

我希望在每个目标文件生成上打印executing行。但这没有发生。我的错误在哪里。

1 个答案:

答案 0 :(得分:0)

在Makefile中替换此行:

$(info executing)

这一行:

@echo "executing"