forked from jiazhang0/efi-tpm2-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.mk
33 lines (28 loc) · 844 Bytes
/
env.mk
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
CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)ld
AR := $(CROSS_COMPILE)ar
OBJCOPY := $(CROSS_COMPILE)objcopy
NM := $(CROSS_COMPILE)nm
INSTALL ?= install
EXTRA_CFLAGS ?=
EXTRA_LDFLAGS ?=
DEBUG_BUILD ?=
DESTDIR ?=
# Installation location for pdet.efi
EFI_DESTDIR ?= /boot/efi
prefix ?= /usr
libdir ?= $(prefix)/lib64
bindir ?= $(prefix)/bin
sbindir ?= $(prefix)/sbin
includedir ?= $(prefix)/include
gnuefi_includedir ?= $(includedir)/efi $(includedir)/efi/$(EFI_ARCH)
gnuefi_libdir ?= $(libdir)
LDFLAGS := --warn-common --no-undefined --fatal-warnings \
$(patsubst $(join -Wl,,)%,%,$(EXTRA_LDFLAGS))
CFLAGS := -std=gnu11 -O2 -Wall -Wsign-compare -Werror \
$(addprefix -I, $(TOPDIR)/src/include) \
$(EXTRA_CFLAGS) $(addprefix $(join -Wl,,),$(LDFLAGS))
ifneq ($(DEBUG_BUILD),)
CFLAGS += -ggdb -DDEBUG_BUILD
endif