0
我其中有一個生成文件項目:如何從cmd運行項目? (Windows 7)中
# 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 [email protected] -c $<
%.o:%.cpp
$(CC) $(CPPFLAGS) -o [email protected] -c $<
# [email protected], $<-source
DNAME=f3dProjBasicNoComp12
PROGRAM=project
PROJ_OBJECTS= project.o f3d.o f3dGridLite.o
#the first (default)
all:$(PROGRAM)
project:$(PROJ_OBJECTS)
$(CC) $(LDFLAGS) -o [email protected] $(PROJ_OBJECTS) $(LIBS)
clean:
rm -f $(PROGRAM) *.o core* *.ppm
pack:
make clean
(cd .. && tar cvzf $(DNAME).tgz $(DNAME))
我已經安裝了cygwin的和MinGW,但我不能編譯make文件或運行項目:(我總是得到錯誤: 第一:
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 該項目,但我不知道怎麼用它做什麼>( 請幫我
感謝
用法錯誤是從make&不是從你的項目。 – jman
我明白,但爲什麼?我已經發布了整個makefile我沒有得到它:( – Csabi
你在哪裏發佈了Makefile? – jman