Visual Studio Make而不是GNU Make with Cygwin [英] Visual Studio Make instead of GNU Make with Cygwin

查看:775
本文介绍了Visual Studio Make而不是GNU Make with Cygwin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然试图在Windows上构建VTK。我已经安装Cygwin和我完成配置CMake我想。但我面临的错误,你可以看到下面的截图:make命令以某种方式试图通过MS Visual Studio,而我想使用GNU make。我猜这是来自makefile本身,它可能会强制该行为或从我的Cygwin设置。

I'm still trying to build VTK on windows. I have installed Cygwin and I'm done configuring with CMake I think. However I'm facing the error that you can see on the screenshot below: the make command somehow tries to make through MS Visual Studio while I want to use the GNU make. I'm guessing this comes from either the makefile itself which could force that behaviour or from my Cygwin settings.

先感谢帮助

>

Makefile内容:

Makefile content:

# CMAKE generated file: DO NOT EDIT!
# Generated by "MinGW Makefiles" Generator, CMake Version 3.2

# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:

    #=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

    #=============================================================================
# Set environment variables for the build.

SHELL = cmd.exe

# The CMake executable.
CMAKE_COMMAND = "C:\Program Files (x86)\CMake\bin\cmake.exe"

# The command to remove a file.
RM = "C:\Program Files (x86)\CMake\bin\cmake.exe" -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = C:\Users\Lonni\VTK\VTK-6.2.0

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = C:\Users\Lonni\VTK\Build1

    #=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running         CMake cache editor..."
    "C:\Program Files (x86)\CMake\bin\cmake-gui.exe" -H$(CMAKE_SOURCE_DIR) -    B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running     CMake to regenerate build system..."
    "C:\Program Files (x86)\CMake\bin\cmake.exe" -H$(CMAKE_SOURCE_DIR) -    B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
    $(CMAKE_COMMAND) -E cmake_progress_start     C:\Users\Lonni\VTK\Build1\CMakeFiles     C:\Users\Lonni\VTK\Build1\CMakeFiles\progress.marks
    $(MAKE) -f CMakeFiles\Makefile2 all
    $(CMAKE_COMMAND) -E cmake_progress_start     C:\Users\Lonni\VTK\Build1\CMakeFiles 0
.PHONY : all

# The main clean target
clean:
    $(MAKE) -f CMakeFiles\Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
    $(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
    $(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-    build-system CMakeFiles\Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named vtk-android

# Build rule for target.
vtk-android: cmake_check_build_system
    $(MAKE) -f CMakeFiles\Makefile2 vtk-android
.PHONY : vtk-android

# fast build rule for target.
vtk-android/fast:
    $(MAKE) -f CMakeFiles\vtk-android.dir\build.make CMakeFiles/vtk-    android.dir/build
.PHONY : vtk-android/fast

#=============================================================================
# Target rules for targets named vtk-compile-tools

# Build rule for target.
vtk-compile-tools: cmake_check_build_system
    $(MAKE) -f CMakeFiles\Makefile2 vtk-compile-tools
.PHONY : vtk-compile-tools

# fast build rule for target.
vtk-compile-tools/fast:
    $(MAKE) -f CMakeFiles\vtk-compile-tools.dir\build.make CMakeFiles/vtk-    compile-tools.dir/build
.PHONY : vtk-compile-tools/fast

# Help Target
help:
    @echo The following are some of the valid targets for this Makefile:
    @echo ... all (the default if no target is provided)
    @echo ... clean
    @echo ... depend
    @echo ... vtk-android
    @echo ... edit_cache
    @echo ... rebuild_cache
    @echo ... vtk-compile-tools
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-    build-system CMakeFiles\Makefile.cmake 0
.PHONY : cmake_check_build_system

编辑:make --version给我:

make --version gives me:

 /usr/bin/make --version
GNU Make 4.0
Construit pour x86_64-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
Licence GPLv3+ : GNU GPL version 3 ou ultérieure <http://gnu.org/licenses/gpl.html>
Ceci est un logiciel libre : vous êtes autorisé à le modifier et à la redistribuer.
Il ne comporte AUCUNE GARANTIE, dans la mesure de ce que permet la loi.

 type -a make
make est un alias vers « /usr/bin/make »
make est /usr/bin/make
make est /usr/bin/make


推荐答案

它的第二行:

# Generated by "MinGW Makefiles" Generator, CMake Version 3.2

你生成的makefile是用于MinGW make not Cygwin make。看到Windows命令提示符(CMD)的原因是因为这一行:

The makefile you've generated is meant to be used with MinGW make not Cygwin make. The reason you see Windows command prompt (CMD) is because of this line:

SHELL = cmd.exe

这会导致make使用cmd.exe作为shell调用所有命令。这就是MinGW通常做的,但Cygwin的期望调用一个shell,它接受Unix Bourne shell类型参数。参数结束被cmd忽略,然后它的行为就像没有任何启动。

This causes make to invoke all commands using cmd.exe as the shell. That's what's MinGW's make normally does anyways, but Cygwin's make expects to invoke a shell that takes Unix Bourne shell type arguments. The arguments end being ignored by cmd, which then behaves as if it was started without any.

你将要重建makefile以便与Cygwin兼容或安装MinGW并使用它来编译它。

You're either going to have rebuild the makefile so that's compatible with Cygwin or install MinGW and use that to compile it.

这篇关于Visual Studio Make而不是GNU Make with Cygwin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆