1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
include $(TOP)/Make.version
ifneq ($(origin RELEASE),undefined)
DASHRELEASE ?= -$(RELEASE)
else
DASHRELEASE ?=
endif
NAME = fwupdate
COMMIT_ID = $(shell git log -1 --pretty=%H 2>/dev/null || echo master)
INSTALL ?= install
MAKE ?= make
PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
READELF = eu-readelf
XGETTEXT = xgettext
ABIDIFF := abidiff
ABIDW := abidw
prefix ?= /usr/
prefix := $(abspath $(prefix))
exec_prefix ?= $(prefix)
ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
ifeq ($(ARCH),x86_64)
LIBDIR ?= $(exec_prefix)/lib64
ifeq "$(wildcard $(LIBDIR) )" ""
LIBDIR = $(exec_prefix)/lib/x86_64-linux-gnu
endif
endif
ifeq ($(ARCH),ia32)
LIBDIR ?= $(exec_prefix)/lib
endif
ifeq ($(ARCH),aarch64)
LIBDIR ?= $(exec_prefix)/lib64
endif
ifeq ($(ARCH),arm)
LIBDIR ?= $(exec_prefix)/lib
endif
LIBDIR ?= unknown
ifeq ($(LIBDIR),unknown)
$(error Architecture $(ARCH) is not a supported build target.)
endif
ifneq ($(origin RPMARCH),undefined)
DOTARCH ?= .$(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,i686,)
else
DOTARCH ?= .$(RPMARCH)
endif
GNUEFIDIR ?= $(LIBDIR)/gnuefi
ifeq "$(wildcard $(GNUEFIDIR) )" ""
GNUEFIDIR = $(prefix)/lib
endif
libdir ?= $(LIBDIR)
pcdir ?= $(libdir)/pkgconfig
mandir ?= $(prefix)/share/man
includedir ?= $(prefix)/include
bindir ?= $(exec_prefix)/bin
datadir ?= $(prefix)/share
localedir ?= $(datadir)/locale
libexecdir ?= $(exec_prefix)/libexec
ifeq "$(wildcard $(libexecdir) )" ""
libexecdir = $(exec_prefix)/lib
endif
libdatadir ?= $(exec_prefix)/lib
sharedstatedir ?= /var/lib
EFIDIR ?= $(shell x=$$(which --skip-alias --skip-functions git 2>/dev/null) ; [ -n "$$x" ] && git config --get fwupdate.efidir)
ifeq ($(EFIDIR),)
ifneq ("$(wildcard /etc/os-release)","")
RELEASE := /etc/os-release
else ifneq ("$(wildcard /usr/lib/os-release)","")
RELEASE := /usr/lib/os-release
endif
ifneq ($(RELEASE),)
EFIDIR = $(shell sed '/^ID=/!d; s/ID=//' $(RELEASE))
endif
ifeq ($(EFIDIR),)
EFIDIR_ERROR = $(error EFIDIR or .gitconfig fwupdate.efidir must be set to this distro's reserved EFI System Partition subdirectory name)
endif
endif
ESPMOUNTPOINT ?= $(shell x=$$(which --skip-alias --skip-functions git 2>/dev/null) ; [ -n "$$x" ] && git config --get fwupdate.espmountdir)
ifeq ($(ESPMOUNTPOINT),)
ESPMOUNTPOINT = "/boot/efi"
endif
DEBUGINFO ?= $(exec_prefix)/lib/debug
DEBUGSOURCE ?= $(prefix)/src/debug
TARGETDIR ?= $(ESPMOUNTPOINT)/EFI/$(EFIDIR)
.PHONY: check_efidir_error
check_efidir_error : ; $(EFIDIR_ERROR) $(info Building with EFIDIR as $(EFIDIR))
|