2011-12-08 8 views
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の両方がインストールされているが、私はメイクファイルをコンパイルしたり、プロジェクトを実行することはできません:(私はいつもエラーが表示されます。 最初:

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 と呼ばれるプロジェクトを実行する必要があります。しかし、私はそれをどうするかわかりません>( 私を助けてください

感謝

+0

使用時エラーは、プロジェクトからのメイク&ではないからです。 – jman

+0

私はそれを理解しますが、なぜですか?私はメイクファイル全体を投稿しました。( – Csabi

+0

あなたはMakefileをどこに投稿しましたか? – jman

答えて

1

メイク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 
  • あなたは指定しませんメイクファイル、nがあるのでo -f
  • あなたは1つのオプションを持っています:-B
  • およびC:\Users\Bladeszasza\Documents\vvd\f3dProjBasicNoComp12\Makefileが対象です。

は、あなたが代わりに行うために必要なのはこれです:あなたが見ている

mingw32-make.exe -f C:\Users\Bladeszasza\Documents\vvd\f3dProjBasicNoComp12\Makefile -B all 
関連する問題