【发布时间】:2015-03-13 21:02:23
【问题描述】:
这个 GNU makefile 如何查找 windows(我必须使用 nmake 和 CL):
CC = gcc
CFLAGS = -Wall -Wextra -g
build: main
main: utils.o bucket.o hashset.o main.o
utils.o: utils.c utils.h
bucket.o: bucket.c bucket.h
hashset.o: hashset.c hashset.h
main.o: main.c
.PHONY:
clean:
rm -f *.o *~ main
我能想到的只有这个:
CPP = cl
CFLAGS = /nologo /W4 /EHsc /Za
build : main
main: utils.obj bucket.obj hashset.obj main.obj
$(CPP) $(CFLAGS) /Fe$@ $**
utils.obj: utils.c
$(CPP) $(CFLAGS) /Fo$@ $**
bucket.obj: bucket.c
$(CPP) $(CFLAGS) /Fo$@ $**
hashset.obj: hashset.c
$(CPP) $(CFLAGS) /Fo$@ $**
main.obj: main.c
$(CPP) $(CFLAGS) /Fo$@ $**
clean:
del *.obj main
请注意,我的作业是实现一个哈希集,我已经完成了,它只是现在困扰我的 makefile。 我不断收到每个文件的错误:文件意外结束
【问题讨论】:
-
错误说明了什么? (错误,整个错误,只有错误)
-
致命错误 C1004:发现意外的文件结尾 NMAKE:致命错误 U1077:'"F:\Program Files\Microsoft Visual Studio 12.0 Ultimate 2013\VC\BIN\cl.EXE"':返回码“0x2”停止。
-
您是否尝试在 Makefile 的最后一行之后按 Enter 键?
-
在 makefile 末尾换行没有帮助
-
我也收到此警告:F:\Program Files\Microsoft Visual Studio 12.0 Ultimate 2013\VC\INCLUDE\sal.h(156) : 警告 C4001: nonstandard extension 'single line comment' was used
标签: c windows makefile nmake cl