From 3537d91c61d93bc4a07879e9c6bb6cea5c44c1c5 Mon Sep 17 00:00:00 2001 From: Lans Zhang Date: Wed, 21 Sep 2016 11:19:25 +0800 Subject: [PATCH] become more friendly for the cross compilation Allow to overwrite certain settings from the external. Signed-off-by: Lans Zhang --- Makefile | 15 ++++++++++----- lib/Makefile | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6ece282..cc94fbe 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,11 @@ endif CC = $(CROSS_COMPILE)gcc LD = $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy +OPENSSL ?= openssl +HEXDUMP ?= hexdump +PK12UTIL ?= pk12util +CERTUTIL ?= certutil +PESIGN ?= pesign ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,) OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.*\((.*)\|version\) //g' | cut -f1-2 -d.` \>= 2.24) @@ -108,11 +113,11 @@ shim.crt: ./make-certs shim shim@xn--u4h.net all codesign 1.3.6.1.4.1.311.10.3.1 $@ - hexdump -v -e '1/1 "0x%02x, "' $< >> $@ + $(HEXDUMP) -v -e '1/1 "0x%02x, "' $< >> $@ echo "};" >> $@ version.c : version.c.in @@ -123,8 +128,8 @@ version.c : version.c.in certdb/secmod.db: shim.crt -mkdir certdb - pk12util -d certdb/ -i shim.p12 -W "" -K "" - certutil -d certdb/ -A -i shim.crt -n shim -t u + $(PK12UTIL) -d certdb/ -i shim.p12 -W "" -K "" + $(CERTUTIL) -d certdb/ -A -i shim.crt -n shim -t u shim.o: $(SOURCES) shim_cert.h shim.o: $(wildcard *.h) @@ -186,7 +191,7 @@ endif $(FORMAT) $^ $@.debug %.efi.signed: %.efi certdb/secmod.db - pesign -n certdb -i $< -c "shim" -s -o $@ -f + $(PESIGN) -n certdb -i $< -c "shim" -s -o $@ -f clean: $(MAKE) -C Cryptlib clean diff --git a/lib/Makefile b/lib/Makefile index d93a26d..37f5746 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -5,7 +5,7 @@ LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variab EFI_INCLUDES = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I../include lib.a: $(LIBFILES) - ar rcs lib.a $(LIBFILES) + $(AR) rcs lib.a $(LIBFILES) all: $(TARGET)