Skip to content

Commit 1aaa760

Browse files
authored
Merge pull request #9807 from ziggie1984/skip-vendor-and-source-packaging-cross-builds
make: allow skipping the vendor and source packaging
2 parents b1b3c64 + c65cf7f commit 1aaa760

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ manpages:
134134
#? install: Build and install lnd and lncli binaries and place them in $GOPATH/bin.
135135
install: install-binaries
136136

137-
#? install-all: Performs all the same tasks as the install command along with generating and
138-
# installing the man pages for the lnd and lncli binaries. This command is useful in an
139-
# environment where a user has root access and so has write access to the man page directory.
137+
#? install-all: Performs all the same tasks as the install command along with generating and installing the man pages for the lnd and lncli binaries. This command is useful in an environment where a user has root access and so has write access to the man page directory.
140138
install-all: install manpages
141139

142140
#? release-install: Build and install lnd and lncli release binaries, place them in $GOPATH/bin
@@ -145,9 +143,23 @@ release-install:
145143
env CGO_ENABLED=0 $(GOINSTALL) -v -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lnd
146144
env CGO_ENABLED=0 $(GOINSTALL) -v -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lncli
147145

148-
#? release: Build the full set of reproducible release binaries for all supported platforms
149-
# Make sure the generated mobile RPC stubs don't influence our vendor package
150-
# by removing them first in the clean-mobile target.
146+
#? cross-release-install: Build lnd and lncli release binaries for single/all supported platforms to /tmp (useful for checking cross compilation or priming release build cache).
147+
cross-release-install:
148+
@$(call print, "Cross compiling release lnd and lncli.")
149+
for sys in $(BUILD_SYSTEM); do \
150+
echo "Building lnd and lncli for $$sys"; \
151+
export CGO_ENABLED=0 GOOS=$$(echo $$sys | cut -d- -f1) GOARCH=$$(echo $$sys | cut -d- -f2); \
152+
if [ "$$GOARCH" = "armv6" ]; then \
153+
export GOARCH=arm; GOARM=6; \
154+
elif [ "$$GOARCH" = "armv7" ]; then \
155+
export GOARCH=arm; GOARM=7; \
156+
fi; \
157+
$(GOBUILD) -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" -o /tmp/lnd-$$sys $(PKG)/cmd/lnd; \
158+
$(GOBUILD) -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" -o /tmp/lncli-$$sys $(PKG)/cmd/lncli; \
159+
echo; \
160+
done
161+
162+
#? release: Build the full set of reproducible release binaries for all supported platforms. Make sure the generated mobile RPC stubs don't influence our vendor package by removing them first in the clean-mobile target.
151163
release: clean-mobile
152164
@$(call print, "Releasing lnd and lncli binaries.")
153165
$(VERSION_CHECK)

0 commit comments

Comments
 (0)