2017-05-20 109 views
0

os161のユーザーランドを構築しようとしています。私は、コマンドラインで行うと入力すると、私は次のエラーを取得する:Makefileエラー - "***区切り記号がありません"& "***最初のターゲットの前にレシピが始まります"

Makefile 24: ***missing separator (did you mean TAB instead of 8 spaces?). Stop.

私はライン24でMakefileをチェックし、行の先頭にTABを追加しようとしたが、私はその後、取得としてそれが動作しませんでした別のエラー:

# 
# 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) [email protected]) 
    (cd userland && $(MAKE) [email protected]) 

clean: 
    (cd kern && $(MAKE) [email protected]) 
    (cd userland && $(MAKE) [email protected]) 
    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)である:ここ

Makefile 24: ***recipe commences before first target. Stop.

は、参照の完全なメイクファイルである

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

ご協力いただければ幸いです。私は同様のメイクファイルのエラーをチェックアウトしたが、何が間違っているのか分からないようだ。

+0

この行は 'all:'行の後ろに少なくとも –

+0

には区切り文字の誤りがあります。すべてを入れようとしました:; –

+0

この問題は修正されましたが、makefileの構文とは関係がありませんでした。私のデフォルトmakeはGNU makeでした。代わりにBSD makeを使用しなければなりませんでした。 –

答えて

0

は、特にinclude directiveについて、慎重にdocumentation of GNU makeをお読みください。

あなた

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

です(誤って)パスを二重引用符で始まるファイルを含めることを要求(およびおそらくいずれかを持っていないが、そうincludeが失敗した...)

欲しい

-include $(TOP)/mk/os161.config.mk 

この行は、ドットではなく、マイナス記号またはダッシュで始まります。

タブの文字はそのままにしてください。

ところで、FreeBSD makeは、開始ドット付きの.includeディレクティブを受け入れ、パスを二重引用符で囲む必要があります。

+0

これは将来の参照に役立ちます。この場合、OS161のドキュメントがあればBSD makeが必要でしたが、GNU makeを使っていました。私は、構文がGNU makeでは間違っていると思っていますが、BSDではそうではないので、エラーを見つけやすくなります。ありがとう:) –

0

セパレータは<TAB>です。

スニペット...の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 
関連する問題