首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Makefile错误-“*缺少分隔符”&“*配方在第一个目标之前开始”

Makefile错误-“*缺少分隔符”&“*配方在第一个目标之前开始”
EN

Stack Overflow用户
提问于 2017-05-20 02:34:57
回答 1查看 954关注 0票数 1

我正在尝试为os161构建用户土地。当我在命令行中输入make时,会得到以下错误:

Makefile 24:*缺少分隔符(您是指TAB而不是8个空格吗?)停止播放。

我检查了第24行的Makefile,并尝试在行的开头添加一个TAB,但是这没有起作用,因为我随后得到了另一个错误:

Makefile 24:*配方在第一个目标之前开始。停止播放。

下面是完整的makefile供参考:

代码语言:javascript
复制
#
# Toplevel makefile for OS/161.
#
#
# Main rules:
#    all (default):  depend and compile system; install into staging area
#    rebuild:        likewise, but start with a clean slate.
#    fullrebuild:    likewise, but start with a very clean slate.
#
# What all does, in order:
#    tools:          depend and compile the tools used in build.
#    includes:       install header files.
#    build:          depend and compile the system.
#
# Other targets:
#    depend:         just update make dependency information.
#    tags:           generate/regenerate "tags" files.
#    install:        install into $(OSTREE).
#    clean:          remove generated files.
#    distclean:      remove all generated files.
#

TOP=.
.include "$(TOP)/mk/os161.config.mk"

all:;  # make this first

MKDIRS=$(OSTREE)

.include "$(TOP)/mk/os161.mkdirs.mk"

all: tools .WAIT includes .WAIT build

rebuild:
    $(MAKE) clean
    $(MAKE) all

fullrebuild:
    $(MAKE) distclean
    $(MAKE) all

# currently no tools required, hence no tools/ dir or work to do
tools:
    @true

build:
    (cd userland && $(MAKE) build)
    (cd man && $(MAKE) install-staging)
    (cd testscripts && $(MAKE) build)

includes tags depend:
    (cd kern && $(MAKE) $@)
    (cd userland && $(MAKE) $@)

clean:
    (cd kern && $(MAKE) $@)
    (cd userland && $(MAKE) $@)
    rm -rf $(INSTALLTOP)

distclean: clean
    rm -rf $(WORKDIR)

install: $(OSTREE)
    (cd $(INSTALLTOP) && tar -cf - .) | (cd $(OSTREE) && tar -xvf -)


.PHONY: all rebuild fullrebuild tools build includes tags depend
.PHONY: clean distclean

# old BSD name, same as distclean
cleandir: distclean
.PHONY: cleandir

这一行是问题(24)是:

代码语言:javascript
复制
.include "$(TOP)/mk/os161.config.mk"

任何帮助都将不胜感激。我检查了类似的makefile错误,但似乎找不到问题所在。

EN

回答 1

Stack Overflow用户

发布于 2017-05-20 11:37:28

分隔符是<TAB>。请不要使用行开头的空格,Makefile.in .

片段:

代码语言:javascript
复制
21  #
22  
23  
24  TOP=.
25  
26  all:;  # make this first
27  
28  MKDIRS=$(OSTREE)
29  
30  <TAB>include "$(TOP)/mk/os161.mkdirs.mk"
31  
32  all: tools .WAIT includes .WAIT build
33  
34  rebuild:
35  <TAB>$(MAKE) clean
36  <TAB>$(MAKE) all
37  
38  <TAB>fullrebuild:
39  <TAB>$(MAKE) distclean
40  <TAB>$(MAKE) all
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44081364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档