1 # $FreeBSD: head/sys/boot/efi/boot1/Makefile 296769 2016-03-12 21:44:33Z emaste $
9 # architecture-specific loader code
10 SRCS
= boot1.c self_reloc.c start.S ufs_module.c
12 # DO NOT USE -static, this is a special case
16 CFLAGS
+= -I
${.CURDIR
}/..
/include
17 CFLAGS
+= -I
${.CURDIR
}/..
/include/${MACHINE}
18 CFLAGS
+= -I
${.CURDIR
}/..
/..
/..
/contrib
/dev
/acpica
/source
/include
19 CFLAGS
+= -I
${.CURDIR
}/..
/..
/..
/contrib
/edk2
/Include
20 CFLAGS
+= -I
${.CURDIR
}/..
/..
/..
21 CFLAGS
+= -DEFI_UFS_BOOT
23 # Disable stack protector
24 CFLAGS
+= -fno-stack-protector
30 # Always add MI sources and REGULAR efi loader bits
31 .PATH
: ${.CURDIR
}/..
/loader
/arch
/${MACHINE}
32 .PATH
: ${.CURDIR
}/..
/loader
33 .PATH
: ${.CURDIR
}/..
/..
/common
34 CFLAGS
+= -I
${.CURDIR
}/..
/..
/common
37 FILESMODE_boot1.efi
= ${BINMODE}
39 LDSCRIPT
= ${.CURDIR
}/..
/loader
/arch
/${MACHINE}/ldscript.
${MACHINE}
40 LDFLAGS
+= -Wl
,-T
${LDSCRIPT} -Wl
,-Bsymbolic
-shared
42 .if
${MACHINE_ARCH} == "aarch64"
43 CFLAGS
+= -msoft-float
-mgeneral-regs-only
45 .if
${MACHINE_ARCH} == "x86_64"
47 LDFLAGS
+= -Wl
,-znocombreloc
51 # Add libstand for the runtime functions used by the compiler - for example
52 # __aeabi_* (arm) or __divdi3 (i386).
53 # as well as required string and memory functions for all platforms.
63 .if
${MACHINE_ARCH} == "x86_64"
64 EFI_TARGET
= pei-x86-64
72 if
${NM} ${.ALLSRC
} | grep
' U '; then \
73 echo
"Undefined symbols in ${.ALLSRC}"; \
76 ${OBJCOPY} -j .peheader
-j .text
-j .sdata
-j .data \
77 -j .dynamic
-j .dynsym
-j .rel.dyn \
78 -j .rela.dyn
-j .reloc \
80 --output-target
=${EFI_TARGET} ${.ALLSRC
} ${.TARGET
}
82 boot1.o
: ${.CURDIR
}/..
/..
/common
/ufsread.c
84 # The following inserts our objects into a template FAT file system
85 # created by generate-fat.sh
87 # XXX generate-fat.sh needs porting
88 #.include "${.CURDIR}/Makefile.fat"
89 #BOOT1_MAXSIZE?= 131072
91 #boot1.efifat: boot1.efi
92 # @set -- `ls -l boot1.efi`; \
93 # x=$$(($$5-${BOOT1_MAXSIZE})); \
94 # if [ $$x -ge 0 ]; then \
95 # echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\
99 # uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu
100 # mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2
101 # bzip2 -f -d ${.TARGET}.bz2
102 # dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \
105 CLEANFILES
= boot1.efi
107 .
include <bsd.prog.mk
>