我有一个项目,它有一个makefile:
# a simple makefile
# Uncomment, if compression support is desired
#DCOMP=-DWITH_COMPRESSION
#ZLIB=-lz
#Compiler
CC=g++
# compiler switches
#CPPFLAGS=-g -I.
CPPFLAGS=-O -I.
CFLAGS=-O -I. $(DCOMP)
#LDFLAGS=-L/usr/local/lib
#libraries
LIBS= -lm $(ZLIB)
# Compilation rules
# target:source
%.o:%.c
$(CC) $(CFLAGS) -o $@ -c $<
%.o:%.cpp
$(CC) $(CPPFLAGS) -o $@ -c $<
# $@-target, $<-source
DNAME=f3dProjBasicNoComp12
PROGRAM=project
PROJ_OBJECTS= project.o f3d.o f3dGridLite.o
#the first (default)
all:$(PROGRAM)
project:$(PROJ_OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(PROJ_OBJECTS) $(LIBS)
clean:
rm -f $(PROGRAM) *.o core* *.ppm
pack:
make clean
(cd .. && tar cvzf $(DNAME).tgz $(DNAME))我已经安装了cygwin和mingw,但我无法编译make文件或运行项目:(我总是收到错误: first:
C:\Users\Bladeszasza>C:\MinGW\bin\mingw32-make.exe -B C:\Users\Bladeszasza\Docu
ments\vvd\f3dProjBasicNoComp12\Makefile
mingw32-make: Nothing to be done for `C:\Users\Bladeszasza\Documents\vvd\f3dProj
BasicNoComp12\Makefile'.
C:\Users\Bladeszasza>C:\MinGW\bin\mingw32-make.exe -B C:\Users\Bladeszasza\Docu
ments\vvd\f3dProjBasicNoComp12\Makefile
C;\MinGW\bin\mingw32-make: invalid option --z
Usage : mingw32-make [option] [target] ...
Options:因此,我需要运行名为project.cpp的项目,但我不知道如何处理它>(请帮助我
谢谢
发布于 2011-12-09 02:56:02
Make必须像this一样使用
make [ -f makefile ] [ options ] ... [ targets ] ...-B总是用来构建
-B, --always-make
Unconditionally make all targets.所以当你输入:
mingw32-make.exe -B C:\Users\Bladeszasza\Documents\vvd\f3dProjBasicNoComp12\Makefile目标文件您不需要指定makefile,因为没有-f
-B
C:\Users\Bladeszasza\Documents\vvd\f3dProjBasicNoComp12\Makefile is 相反,您需要做的是:
mingw32-make.exe -f C:\Users\Bladeszasza\Documents\vvd\f3dProjBasicNoComp12\Makefile -B allhttps://stackoverflow.com/questions/8435217
复制相似问题