-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (34 loc) · 1.12 KB
/
Makefile
File metadata and controls
45 lines (34 loc) · 1.12 KB
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
# SPDX-License-Identifier: LGPL-2.1-or-later
ARCH?= $(shell uname -m)
PREFIX?= /usr/local
MIN_SECTIONS?=2048
include ./Make.defaults
ifeq ($(ARCH),x86_64)
CFLAGS += -m64 -march=x86-64 -mno-red-zone -mgeneral-regs-only -maccumulate-outgoing-args
LDFLAGS += -m64
endif
ifeq ($(ARCH),aarch64)
CFLAGS += -mgeneral-regs-only
endif
OBJS = devicetree.o efi-log.o efi-efivars.o efi-string.o linux.o stub.o util.o uki.o smbios.o initrd.o \
pe.o chid.o edid.o secure-boot.o sha1.o measure.o
.PHONY: all clean install
all: stubble.efi
%.o: %.c
$(CC) $< $(CFLAGS) -c -o $@
stubble.efi: stubble
./elf2efi.py --version-major=6 --version-minor=16 \
--efi-major=1 --efi-minor=1 --subsystem=10 \
--minimum-sections=${MIN_SECTIONS} \
--copy-sections=".sbat" $< $@
stubble: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
install: stubble.efi
install -m 755 -d ${DESTDIR}${PREFIX}/lib/stubble
install -m 644 -t ${DESTDIR}${PREFIX}/lib/stubble stubble.efi
install -m 755 -d ${DESTDIR}${PREFIX}/share/stubble/hwids
install -m 644 -t ${DESTDIR}${PREFIX}/share/stubble/hwids hwids/json/*
clean:
rm -f $(OBJS)
rm -f stubble
rm -f stubble.efi