简体   繁体   English

Cygwin中的Makefile行为

[英]Makefile behavior in Cygwin

when i try to do compile Keys.c program using Makefile in Cygwin on Windows 7 64bit 当我尝试在Windows 7 64bit上的Cygwin使用Makefile编译Keys.c程序时

it should compile it as following 它应该如下编译

gcc -g -Wall -ansi -c keys.c 

but i get the following 但我得到以下

`cc     keys.c   -o keys`  not `gcc -g -Wall -ansi -c keys.c`

the make file is as follow 制作文件如下

CC = gcc
CFLAGS = -g -Wall -ansi

keys:   keys.c
    $(CC) $(CFLAGS) -c keys.c 

Remove -c before keys.c whats happening here is when you give keys.c之前删除-c这是发生什么情况,当您给出

$(CC) $(CFLAGS) -c keys.c

then only the object file keys.o is created. 然后仅创建目标文件keys.o Since the rule for making the final target is not written the makefile will use the implicit rule to create the target. 由于未写入用于制定最终目标的规则,因此makefile将使用隐式规则来创建目标。

CC = gcc
CFLAGS = -g -Wall -ansi

keys:   keys.c
    $(CC) $(CFLAGS) keys.c 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM