我正在尝试构建OS161的用户区。当我在命令行中键入make时,会出现以下错误:
Makefile 24:***缺少分隔符(您是指制表符而不是8个空格吗?)。停下来。
我检查了Makefile的第24行,并尝试在行的开头添加一个制表符,但是没有起作用,因为我随后得到了另一个错误:
生成文件24:***制作方法在第一个目标之前开始。停下来。
下面是完整的makefile以供参考:
#
# 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)的行是:
.include "$(TOP)/mk/os161.config.mk"
如有任何帮助,我们将不胜感激。我检查了类似的makefile错误,但我似乎找不到哪里出了问题。
仔细阅读GNU make的文档,特别是关于include指令的文档。
您的
.include "$(TOP)/mk/os161.config.mk"
(错误地)请求包含路径以双引号开头的文件(您可能没有双引号,因此include
失败。。。)
你想要
-include $(TOP)/mk/os161.config.mk
这一行以减号或破折号开头,而不是点号。
请确保使用编辑器保持制表符字符不变。
顺便说一句,FreeBSD make接受以点开头的.include
指令,并且需要双引号中的路径。
分隔符是
。请不要在Makefile,Makefile.in.。。
代码段:
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