草庐IT

Windows 崇高文本 3 "make: *** No targets specified and no makefile found. Stop."

coder 2024-06-13 原文

很多人显然出于某种原因遇到了这个问题,但我还没有找到适用于我的特定案例的任何已回答问题。如果有一个我错过了,我当然会很感激被指出来(最好是以一种尊重的方式)。

如问题所示,我在 Windows 7 x64 机器上使用 Sublime Text 3(稳定版,Build 3059)。我正在为我的项目使用 make 构建系统,因为这是我工作时在 Mac 上使用的系统,虽然它不一定在 Windows 上最有意义(没有双关语意),但它确实应该使用正确的设置。我意识到我可以通过不使用 make 来避免这个问题,但我更愿意了解问题是什么而不是(或除此之外)只是做其他事情。以下是来自命令行的一些信息(即普通的 Windows 命令提示符):

C:\Users\xt\code\d3>where make
C:\cygwin64\bin\make.exe

C:\Users\xt\code\d3>echo %path%
C:\Users\xt\AppData\Roaming\npm;C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Script
s\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\
x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\
WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Sta
tic;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x8
6)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm

请注意,Windows 在 C:\cygwin64\bin\make.exeC:\Cygwin64\bin\ 中找到了 make 命令也在我的路径中。我不认为大小写差异是问题,因为 Sublime Text 并不是在提示无法找到 make,而是在提示找不到 makefile。

这是我正在使用的目录结构

C:\Users\xt\code\d3>ls -R
.:
Makefile  README.txt  coffee  css  index.html  js  license.txt

./coffee:
index.coffee

./css:
style.css

./js:

请注意,Makefile 实际上存在于 d3 目录中。

我在Sublime Text中打开d3目录如下:

  1. 从“开始”菜单打开 Sublime Text
  2. 在 Sublime Text 中,文件 > 打开文件夹... > C:\Users\xt\code\d3
  3. 点击边栏中的Makefile

Makefile 的内容如下:

.PHONY: all
all: js/index.js

js/%.js: coffee/%.coffee
    coffee -co $(@D) $<

.PHONY: clean
clean:
    rm -r js

郑重声明,每个配方行都以 TAB 字符开头,而不是空格。

查看 Tools > Build Systems 显示我当前的构建系统是Automatic。运行构建产生以下输出:

make: *** No targets specified and no makefile found.  Stop.
[Finished in 0.2s with exit code 2]
[shell_cmd: make]
[dir: C:\Users\xt\code\d3]    
[path: C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Scripts\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm]

因此,它找到了 make 命令,并且它从 C:\Users\xt\code\d3 目录运行,如前所述,该目录确实包含一个名为 Makefile 的生成文件。

当我在命令行上尝试同样的操作时,我得到以下信息:

C:\Users\xt\code\d3>make
coffee -co js coffee/index.coffee

...并且,确认成功的结果:

C:\Users\xt\code\d3>ls -R
.:
Makefile  README.txt  coffee  css  index.html  js  license.txt

./coffee:
index.coffee

./css:
style.css

./js:
index.js

我尝试通过创建一个新的构建系统(工具 > 构建系统 > 新构建系统...)来调试 Sublime Text 中的制作过程,保存为 C:\Users\xt\AppData\Roaming\Sublime Text 3\Packages\User\Make (debug).sublime-build 包含以下内容:

{
    "shell_cmd": "make -dr"
}

当我尝试使用这个新的构建系统 Make (debug) 进行构建时,我得到以下结果:

GNU Make 4.0
Built for x86_64-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
 Considering target file 'GNUmakefile'.
  File 'GNUmakefile' does not exist.
  Looking for an implicit rule for 'GNUmakefile'.
  No implicit rule found for 'GNUmakefile'.
  Finished prerequisites of target file 'GNUmakefile'.
 Must remake target 'GNUmakefile'.
 Failed to remake target file 'GNUmakefile'.
 Considering target file 'makefile'.
  File 'makefile' does not exist.
  Looking for an implicit rule for 'makefile'.
  No implicit rule found for 'makefile'.
  Finished prerequisites of target file 'makefile'.
 Must remake target 'makefile'.
 Failed to remake target file 'makefile'.
 Considering target file 'Makefile'.
  File 'Makefile' does not exist.
  Looking for an implicit rule for 'Makefile'.
  No implicit rule found for 'Makefile'.
  Finished prerequisites of target file 'Makefile'.
 Must remake target 'Makefile'.
 Failed to remake target file 'Makefile'.
make: *** No targets specified and no makefile found.  Stop.
[Finished in 0.2s with exit code 2]
[shell_cmd: make -dr]
[dir: C:\Users\xt\code\d3]
[path: C:\Cygwin64\bin\;C:\Python27\;C:\Python27\Scripts\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\julia;C:\Users\xt\AppData\Roaming\npm]

不出所料,make 找不到GNUmakefilemakefile,但由于某种原因它找不到Makefile,尽管声称在 [dir: C:\Users\xt\code\d3] 中运行。为了进行比较,这里是相应的命令行输出:

C:\Users\xt\code\d3>make -dr
GNU Make 4.0
Built for x86_64-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Updating makefiles....
 Considering target file 'Makefile'.
  Looking for an implicit rule for 'Makefile'.
  No implicit rule found for 'Makefile'.
  Finished prerequisites of target file 'Makefile'.
 No need to remake target 'Makefile'.
Updating goal targets....
Considering target file 'all'.
 File 'all' does not exist.
  Considering target file 'js/index.js'.
   Looking for an implicit rule for 'js/index.js'.
   Trying pattern rule with stem 'index'.
   Trying implicit prerequisite 'coffee/index.coffee'.
   Found an implicit rule for 'js/index.js'.
    Considering target file 'coffee/index.coffee'.
     Looking for an implicit rule for 'coffee/index.coffee'.
     No implicit rule found for 'coffee/index.coffee'.
     Finished prerequisites of target file 'coffee/index.coffee'.
    No need to remake target 'coffee/index.coffee'.
   Finished prerequisites of target file 'js/index.js'.
   Prerequisite 'coffee/index.coffee' is older than target 'js/index.js'.
  No need to remake target 'js/index.js'.
 Finished prerequisites of target file 'all'.
Must remake target 'all'.
Successfully remade target file 'all'.
make: Nothing to be done for 'all'.

在这里,make 找到了 Makefile,就在我们知道的地方。这就是我达到众所周知的技巧的尽头的地方。

所以...感谢所有费心阅读所有这些内容的人,感谢您的反馈。

最佳答案

检查行尾,因为 Windows、Linux 和 Mac 使用不同的行尾。

view -> Line endings 中更改行结束设置尝试使用不同的选项并检查(可能是它的 Windows,切换到 Mac 并检查一次)。

关于Windows 崇高文本 3 "make: *** No targets specified and no makefile found. Stop.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25478201/

有关Windows 崇高文本 3 "make: *** No targets specified and no makefile found. Stop."的更多相关文章

  1. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  2. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  3. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  4. ruby - 使用 ruby​​ 将 HTML 转换为纯文本并维护结构/格式 - 2

    我想将html转换为纯文本。不过,我不想只删除标签,我想智能地保留尽可能多的格式。为插入换行符标签,检测段落并格式化它们等。输入非常简单,通常是格式良好的html(不是整个文档,只是一堆内容,通常没有anchor或图像)。我可以将几个正则表达式放在一起,让我达到80%,但我认为可能有一些现有的解决方案更智能。 最佳答案 首先,不要尝试为此使用正则表达式。很有可能你会想出一个脆弱/脆弱的解决方案,它会随着HTML的变化而崩溃,或者很难管理和维护。您可以使用Nokogiri快速解析HTML并提取文本:require'nokogiri'h

  5. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  6. ruby-on-rails - rails : How to make a form post to another controller action - 2

    我知道您通常应该在Rails中使用新建/创建和编辑/更新之间的链接,但我有一个情况需要其他东西。无论如何我可以实现同样的连接吗?我有一个模型表单,我希望它发布数据(类似于新View如何发布到创建操作)。这是我的表格prohibitedthisjobfrombeingsaved: 最佳答案 使用:url选项。=form_for@job,:url=>company_path,:html=>{:method=>:post/:put} 关于ruby-on-rails-rails:Howtomak

  7. ruby-on-rails - 迷你测试错误 : "NameError: uninitialized constant" - 2

    我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test

  8. ruby-on-rails - 相关表上的范围为 "WHERE ... LIKE" - 2

    我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que

  9. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  10. ruby - 安装 Ruby 时遇到问题(无法下载资源 "readline--patch") - 2

    当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub

随机推荐