From 6e8605a44c96dfcca9b9122a593e02bd11e74fae Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 23 Sep 2019 21:04:41 +0000 Subject: [PATCH] build: Add `make install` Following https://github.com/coreos/ignition-dracut/pull/106 add a default `make install` rule that honors `DESTDIR`. Main motivation is hacking on ignition in a unified way with ostree, ignition-dracut and other projects using coreos-assembler. (Backport of #858) --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 33da018d8..d0631c65d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,23 @@ +# Canonical version of this in https://github.com/coreos/coreos-assembler/blob/6eb97016f4dab7d13aa00ae10846f26c1cd1cb02/Makefile#L19 +GOARCH:=$(shell uname -m) +ifeq ($(GOARCH),x86_64) + GOARCH=amd64 +else ifeq ($(GOARCH),aarch64) + GOARCH=arm64 +endif + .PHONY: all all: ./build +# This currently assumes you're using https://github.com/coreos/ignition-dracut/ +# If in the future any other initramfs integration appears, feel free to add a PR +# to make this configurable. +.PHONY: install +install: all + install -m 0755 -D -t $(DESTDIR)/usr/lib/dracut/modules.d/30ignition bin/$(GOARCH)/ignition + install -m 0755 -D -t $(DESTDIR)/usr/bin bin/$(GOARCH)/ignition-validate + .PHONY: vendor vendor: @glide --quiet update --strip-vendor