@@ -66,16 +66,31 @@ bin/buildah: $(SOURCES) internal/mkcw/embed/entrypoint_amd64.gz
6666 $(GO_BUILD ) $(BUILDAH_LDFLAGS ) $(GO_GCFLAGS ) " $( GOGCFLAGS) " -o $@ $(BUILDFLAGS ) ./cmd/buildah
6767 test -z " ${SELINUXOPT} " || chcon --verbose -t $(SELINUXTYPE ) $@
6868
69- ifneq ($(shell $(AS ) --version | grep x86_64) ,)
7069internal/mkcw/embed/entrypoint_amd64.gz : internal/mkcw/embed/entrypoint_amd64
7170 gzip -k9nf $^
71+ internal/mkcw/embed/entrypoint_arm64.gz : internal/mkcw/embed/entrypoint_arm64
72+ gzip -k9nf $^
73+ internal/mkcw/embed/entrypoint_ppc64le.gz : internal/mkcw/embed/entrypoint_ppc64le
74+ gzip -k9nf $^
75+ internal/mkcw/embed/entrypoint_s390x.gz : internal/mkcw/embed/entrypoint_s390x
76+ gzip -k9nf $^
7277
73- internal/mkcw/embed/entrypoint_amd64 : internal/mkcw/embed/entrypoint_amd64.s
78+ ifneq ($(shell $(AS ) --version | grep -E 'x86_64-([^-]+-) ?linux'),)
79+ internal/mkcw/embed/entrypoint_amd64 : internal/mkcw/embed/asm/entrypoint_amd64.s
7480 $(AS ) -o $(patsubst % .s,% .o,$^ ) $^
7581 $(LD ) -o $@ $(patsubst % .s,% .o,$^ )
7682 $(STRIP ) $@
83+ else
84+ internal/mkcw/embed/entrypoint_amd64 : internal/mkcw/embed/entrypoint_amd64.s internal/mkcw/embed/entrypoint.go
85+ GOOS=linux GOARCH=amd64 $(GO ) build -ldflags " -E _start -s" -o $@ ./internal/mkcw/embed
7786endif
7887
88+ internal/mkcw/embed/entrypoint_arm64 : internal/mkcw/embed/entrypoint_arm64.s internal/mkcw/embed/entrypoint.go
89+ GOOS=linux GOARCH=arm64 $(GO ) build -ldflags " -E _start -s" -o $@ ./internal/mkcw/embed
90+ internal/mkcw/embed/entrypoint_ppc64le : internal/mkcw/embed/entrypoint_ppc64le.s internal/mkcw/embed/entrypoint.go
91+ GOOS=linux GOARCH=ppc64le $(GO ) build -ldflags " -E _start -s" -o $@ ./internal/mkcw/embed
92+ internal/mkcw/embed/entrypoint_s390x : internal/mkcw/embed/entrypoint_s390x.s internal/mkcw/embed/entrypoint.go
93+ GOOS=linux GOARCH=s390x $(GO ) build -ldflags " -E _start -s" -o $@ ./internal/mkcw/embed
7994
8095.PHONY : buildah
8196buildah : bin/buildah
@@ -88,7 +103,7 @@ FREEBSD_CROSS_TARGETS := $(filter bin/buildah.freebsd.%,$(ALL_CROSS_TARGETS))
88103.PHONY : cross
89104cross : $(LINUX_CROSS_TARGETS ) $(DARWIN_CROSS_TARGETS ) $(WINDOWS_CROSS_TARGETS ) $(FREEBSD_CROSS_TARGETS )
90105
91- bin/buildah.% : $(SOURCES )
106+ bin/buildah.% : $(SOURCES ) internal/mkcw/embed/entrypoint_amd64.gz
92107 mkdir -p ./bin
93108 GOOS=$(word 2,$(subst ., ,$@ ) ) GOARCH=$(word 3,$(subst ., ,$@ ) ) $(GO_BUILD ) $(BUILDAH_LDFLAGS ) -o $@ -tags " containers_image_openpgp" ./cmd/buildah
94109
@@ -118,7 +133,7 @@ bin/passwd: tests/passwd/passwd.go
118133
119134.PHONY : clean
120135clean :
121- $(RM ) -r bin tests/testreport/testreport tests/conformance/testdata/mount-targets/true
136+ $(RM ) -r bin tests/testreport/testreport tests/conformance/testdata/mount-targets/true internal/mkcw/embed/entrypoint_amd64 internal/mkcw/embed/entrypoint_arm64 internal/mkcw/embed/entrypoint_ppc64le internal/mkcw/embed/entrypoint_s390x internal/mkcw/embed/ * .gz internal/mkcw/embed/asm/ * .o
122137 $(MAKE ) -C docs clean
123138
124139.PHONY : docs
0 commit comments