【问题标题】:make with Cygwin用 Cygwin 制作
【发布时间】:2015-05-22 15:01:07
【问题描述】:

我正在尝试在 Windows 上设置 VTK(我说这很复杂吗?^^)。 我已经使用 CMake 成功配置了 VTK,现在我正在尝试通过 cygwin 运行 make。但是,当我进入构建目录并输入 make 所有终端打印时,所做的是:

制作

Microsoft Windows [版本 6.3.9600]

(c) 2013 年微软公司。保留所有权利。

有谁知道怎么回事?

编辑:输入 cygcheck 时 我明白了:

Cygwin Package Information
Package              Version        Status
make                 4.0-2           OK

编辑 2:这是我得到的截图(抱歉是法语)

提前感谢您提供的任何帮助:)

编辑 3:新截图 + Makefile 内容

Makefile 内容:

# 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

【问题讨论】:

    标签: windows makefile cygwin


    【解决方案1】:

    Cygwin 的默认安装是quite minimal。它不包括 GNU make,所以你得到的是微软的 make。

    您需要重新运行 Cygwin 的 setup-*.exe 并添加 make。很有可能,您可能还需要其他东西。我建议您打开 Devel 类别并在其中扫描内容。


    编辑,将屏幕截图添加到问题后:

    您的屏幕截图显示了一些混乱。我将一一介绍,并在每种情况下引用文本:

    Pas de cible spécifiée et aucun makefile n'a été trouvé

    在英文中,即“未指定目标且未找到生成文件”。这告诉您 GNU make 已安装并正在运行,但当前目录中没有名为 GNUmakefile、makefile 或 Makefile 的文件。它按顺序搜索这三个。

    这并不奇怪,因为ls 表明您正在一个空目录中运行它。

    /cygdrive/c/MinGW/bin/make

    这里有两个问题:

    1. 正如我在 cmets 中所说,只有链接到 cygwin1.dll 的程序才能理解 /cygdrive。 Windows 的cmd.exe 不知道/cygdrive 是什么意思。 c:\MinGW\bin\make 是cmd.exe 下的正确形式。

    2. MinGW 不是 Cygwin。您在使用 MinGW 时遇到的任何问题都是一个完全独立的问题,与您在使用 Cygwin 的 GNU make 软件包时遇到的问题无关。

    /usr/bin/make

    这与上一项类似:cmd.exe 不知道如何处理 POSIX 路径。因为 Windows 的文件路径解析代码有时将正斜杠视为与反斜杠相同,在这种情况下会被解释为 c:\usr\bin\make,但几乎可以肯定根本没有 c:\usr 目录。

    此路径在左侧屏幕截图中起作用的原因是 Cygwin 将您的 Cygwin 安装目录(例如 c:\cygwin 或 c:\cygwin64,默认情况下)作为 POSIX 根目录,因此 c:\cygwin\usr 对任何用户都显示为 /usr链接到 cygwin1.dll 的程序使用 POSIX API,例如 open(2)。如您所见,这包括 Cygwin 的 GNU bash 版本。

    您不应该要求 Cygwin 终端窗口中的显式路径,因为 /usr/bin 应该在 PATH 中的任何其他内容之前。如果不是这种情况,您可能没有使用 setup.exe 创建的 Cygwin 图标,在这种情况下,您没有正确的登录 shell。要么使用该图标,要么通过调用mintty - 来模仿它的作用,而不仅仅是简单的mintty。

    【讨论】:

    • 纠正我我错了,但是我之前安装的 cygwin 没有 make 并且出现“找不到命令”错误。那么这真的是原因吗?
    • @LonniBesançon:我假设您安装了 Visual Studio,这就是您获得 Microsoft make 的方式。
    • 确实是这样,但是我之前尝试过安装了它,但没有遇到同样的错误。那我怎么可能解决没有make的问题呢?因为我很确定我在 Dev 下检查过它
    • 如果您通过setup.exe 安装的 Cygwin 终端图标(而不是 Windows 控制台)使用 Cygwin,那么 Cygwin 程序应该在 PATH 中排在第一位,在 Visual Studio 之前.您确定ls /usr/bin/make 表明它已安装吗? cygcheck make 或 cygcheck -c make 怎么样?
    • 那么给出明确的路径 (/usr/bin/make) 是否正确?
    猜你喜欢
    • 1970-01-01
    • 2013-11-08
    • 2017-11-25
    • 1970-01-01
    • 1970-01-01
    • 2011-03-31
    • 2013-11-15
    • 2012-12-06
    • 2011-12-27
    相关资源
    最近更新 更多