Fabric 1.1.0无法构建及修改Makefile后orderer编译报错咨询
Hey there, let's break down this make error you're facing with Hyperledger Fabric 1.1.0. That No rule to make target 'build/bin/orderer' message means Make can't find the instructions it needs to build the orderer binary—and since you modified the official Makefile, that's almost certainly where the issue is rooted. Here's how to troubleshoot and fix it:
Check if you removed the orderer target rule
The official Fabric 1.1.0 Makefile includes explicit rules for building the orderer. Look for a section that looks like this:orderer: build/bin/orderer build/bin/orderer: $(ORDERER_GO_FILES) @mkdir -p build/bin go build -o $@ ./cmd/ordererIf you accidentally deleted this block or altered the target path (e.g., changed
build/binto a different directory), Make won't know how to generate the binary. Restore or correct this rule first.Verify critical variable definitions
TheORDERER_GO_FILESvariable in the Makefile lists all the Go source files needed to build the orderer. If you modified or deleted this variable, Make loses track of the dependencies required to compile the binary. Double-check that this variable is still correctly defined and points to all the relevant.gofiles in the orderer module.Don't delete the generic build pattern rule
Fabric's Makefile uses a pattern rule to handle building most binaries consistently. It usually looks like this:build/bin/%: @mkdir -p $(@D) go build -o $@ ./cmd/$*If you removed this rule, even if you have the
orderer: build/bin/ordererline, Make won't know how to generate thebuild/bin/ordererfile itself. Restore this generic rule if it's missing.Compare with the official Makefile to spot differences
To pinpoint exactly what went wrong, back up your modified Makefile, then fetch the original 1.1.0 version (if you're using git, rungit checkout tags/v1.1.0 -- Makefile). Use a diff tool to compare the two files—this will highlight which changes broke the build rules.Quick workaround: Bypass Makefile temporarily
If you need to get the binaries built immediately, skip the Makefile and compile directly withgo build:mkdir -p build/bin go build -o build/bin/orderer ./cmd/orderer go build -o build/bin/peer ./cmd/peerThis will generate the orderer and peer binaries while you fix the Makefile issues.
内容的提问来源于stack exchange,提问作者Jim Green

