1 1.3.2.3 pgoyette # $NetBSD: Makefile.efiboot,v 1.3.2.3 2018/09/30 01:45:57 pgoyette Exp $ 2 1.3.2.2 pgoyette 3 1.3.2.2 pgoyette S= ${.CURDIR}/../../.. 4 1.3.2.2 pgoyette 5 1.3.2.2 pgoyette NOMAN= # defined 6 1.3.2.2 pgoyette NOPIE= # defined 7 1.3.2.2 pgoyette NOLIBCSANITIZER=# defined 8 1.3.2.2 pgoyette NOSANITIZER= # defined 9 1.3.2.2 pgoyette NORELRO= # defined 10 1.3.2.2 pgoyette PROG?= boot.efi 11 1.3.2.2 pgoyette NEWVERSWHAT?= "EFI Boot" 12 1.3.2.2 pgoyette 13 1.3.2.2 pgoyette EFIDIR= ${S}/external/bsd/gnu-efi/dist 14 1.3.2.2 pgoyette GNUEFIARCH?= ${MACHINE_CPU} 15 1.3.2.2 pgoyette CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} 16 1.3.2.2 pgoyette CPPFLAGS+= -I${EFIDIR}/inc/protocol 17 1.3.2.2 pgoyette 18 1.3.2.2 pgoyette LDSCRIPT?= ${EFIDIR}/gnuefi/elf_${GNUEFIARCH}_efi.lds 19 1.3.2.2 pgoyette 20 1.3.2.2 pgoyette AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} 21 1.3.2.2 pgoyette 22 1.3.2.2 pgoyette .PATH: ${EFIDIR}/gnuefi 23 1.3.2.2 pgoyette SOURCES= crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c 24 1.3.2.2 pgoyette SOURCES+= boot.c conf.c console.c dev_net.c devopen.c exec.c panic.c prompt.c 25 1.3.2.3 pgoyette SOURCES+= efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c 26 1.3.2.2 pgoyette 27 1.3.2.2 pgoyette .PATH: ${S}/external/bsd/libfdt/dist 28 1.3.2.2 pgoyette CPPFLAGS+= -I${S}/external/bsd/libfdt/dist 29 1.3.2.2 pgoyette SOURCES+= fdt.c fdt_addresses.c fdt_empty_tree.c 30 1.3.2.2 pgoyette SOURCES+= fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c 31 1.3.2.2 pgoyette 32 1.3.2.2 pgoyette SRCS= ${SOURCES} ${EXTRA_SOURCES} 33 1.3.2.2 pgoyette 34 1.3.2.2 pgoyette .include <bsd.init.mk> 35 1.3.2.2 pgoyette 36 1.3.2.2 pgoyette STRIPFLAG= # nothing 37 1.3.2.2 pgoyette 38 1.3.2.2 pgoyette LIBCRT0= # nothing 39 1.3.2.2 pgoyette LIBCRTI= # nothing 40 1.3.2.2 pgoyette LIBCRTBEGIN= # nothing 41 1.3.2.2 pgoyette LIBCRTEND= # nothing 42 1.3.2.2 pgoyette LIBC= # nothing 43 1.3.2.2 pgoyette 44 1.3.2.2 pgoyette BINDIR=/usr/mdec 45 1.3.2.2 pgoyette BINMODE=444 46 1.3.2.2 pgoyette 47 1.3.2.2 pgoyette .PATH: ${.CURDIR} ${.CURDIR}/.. 48 1.3.2.2 pgoyette .PATH: ${.CURDIR}/../../lib 49 1.3.2.2 pgoyette 50 1.3.2.2 pgoyette LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared 51 1.3.2.2 pgoyette CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/../common -I$S/lib/libsa 52 1.3.2.2 pgoyette CPPFLAGS+= -I${.OBJDIR} 53 1.3.2.2 pgoyette CPPFLAGS+= -I${.CURDIR}/../../lib 54 1.3.2.2 pgoyette 55 1.3.2.2 pgoyette COPTS+= -fpic -g -O2 56 1.3.2.2 pgoyette COPTS+= -fshort-wchar -fno-strict-aliasing 57 1.3.2.2 pgoyette COPTS+= -ffreestanding -fno-stack-protector 58 1.3.2.2 pgoyette LDFLAGS+= --defsym=EFI_SUBSYSTEM=0xa 59 1.3.2.2 pgoyette 60 1.3.2.2 pgoyette 61 1.3.2.2 pgoyette COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} 62 1.3.2.2 pgoyette CPPFLAGS+= -nostdinc -D_STANDALONE 63 1.3.2.2 pgoyette CPPFLAGS+= -DEFIBOOT 64 1.3.2.3 pgoyette CPPFLAGS+= -DPROGRESS_FN=efi_progress 65 1.3.2.2 pgoyette 66 1.3.2.2 pgoyette CPPFLAGS+= -Wall -Wmissing-prototypes 67 1.3.2.2 pgoyette CPPFLAGS+= -Wno-pointer-sign 68 1.3.2.2 pgoyette 69 1.3.2.2 pgoyette CPPFLAGS+= -DHEAP_VARIABLE 70 1.3.2.2 pgoyette #CPPFLAGS+= -DSUPPORT_CD9660 71 1.3.2.2 pgoyette CPPFLAGS+= -D"devb2cdb(bno)=(bno)" 72 1.3.2.2 pgoyette CPPFLAGS+= -DSUPPORT_DOSFS 73 1.3.2.2 pgoyette #CPPFLAGS+= -DSUPPORT_EXT2FS 74 1.3.2.2 pgoyette CPPFLAGS+= -DSUPPORT_BOOTP 75 1.3.2.2 pgoyette CPPFLAGS+= -DSUPPORT_DHCP 76 1.3.2.2 pgoyette #CPPFLAGS+= -DSUPPORT_NFS 77 1.3.2.2 pgoyette CPPFLAGS+= -DSUPPORT_TFTP 78 1.3.2.2 pgoyette CPPFLAGS+= -DLIBSA_ENABLE_LS_OP 79 1.3.2.2 pgoyette 80 1.3.2.2 pgoyette #CPPFLAGS+= -DARP_DEBUG 81 1.3.2.2 pgoyette #CPPFLAGS+= -DBOOTP_DEBUG 82 1.3.2.2 pgoyette #CPPFLAGS+= -DNET_DEBUG 83 1.3.2.2 pgoyette #CPPFLAGS+= -DNETIF_DEBUG 84 1.3.2.2 pgoyette #CPPFLAGS+= -DNFS_DEBUG 85 1.3.2.2 pgoyette #CPPFLAGS+= -DRARP_DEBUG 86 1.3.2.2 pgoyette #CPPFLAGS+= -DRPC_DEBUG 87 1.3.2.2 pgoyette 88 1.3.2.2 pgoyette SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT 89 1.3.2.2 pgoyette SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT 90 1.3.2.2 pgoyette SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" 91 1.3.2.2 pgoyette 92 1.3.2.2 pgoyette ### find out what to use for libsa 93 1.3.2.2 pgoyette SA_AS= library 94 1.3.2.2 pgoyette SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 95 1.3.2.2 pgoyette SAMISCMAKEFLAGS+="SA_USE_CREAD=yes" 96 1.3.2.2 pgoyette SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes" 97 1.3.2.2 pgoyette SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" 98 1.3.2.2 pgoyette .include "${S}/lib/libsa/Makefile.inc" 99 1.3.2.2 pgoyette LIBSA= ${SALIB} 100 1.3.2.2 pgoyette 101 1.3.2.2 pgoyette ### find out what to use for libkern 102 1.3.2.2 pgoyette KERN_AS= library 103 1.3.2.2 pgoyette LIBKERN_ARCH?= ${MACHINE_ARCH} 104 1.3.2.2 pgoyette KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" 105 1.3.2.2 pgoyette .include "${S}/lib/libkern/Makefile.inc" 106 1.3.2.2 pgoyette LIBKERN= ${KERNLIB} 107 1.3.2.2 pgoyette 108 1.3.2.2 pgoyette ### find out what to use for libz 109 1.3.2.2 pgoyette Z_AS= library 110 1.3.2.2 pgoyette .include "${S}/lib/libz/Makefile.inc" 111 1.3.2.2 pgoyette LIBZ= ${ZLIB} 112 1.3.2.2 pgoyette 113 1.3.2.2 pgoyette ### find out what to use for libgnuefi 114 1.3.2.2 pgoyette GNUEFI_AS= library 115 1.3.2.2 pgoyette LIBGNUEFI_ARCH?= ${MACHINE_ARCH} 116 1.3.2.2 pgoyette GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" 117 1.3.2.2 pgoyette GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib 118 1.3.2.2 pgoyette .include "${S}/lib/libgnuefi/Makefile.inc" 119 1.3.2.2 pgoyette LIBGNUEFI= ${GNUEFILIB} 120 1.3.2.2 pgoyette 121 1.3.2.2 pgoyette cleandir distclean: .WAIT cleanlibdir 122 1.3.2.2 pgoyette 123 1.3.2.2 pgoyette cleanlibdir: 124 1.3.2.2 pgoyette -rm -rf lib 125 1.3.2.2 pgoyette 126 1.3.2.2 pgoyette LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} 127 1.3.2.2 pgoyette 128 1.3.2.2 pgoyette VERSIONMACHINE=evbarm 129 1.3.2.2 pgoyette .include "${S}/conf/newvers_stand.mk" 130 1.3.2.2 pgoyette 131 1.3.2.2 pgoyette CLEANFILES+= ${PROG}.so ${PROG}.tmp 132 1.3.2.2 pgoyette 133 1.3.2.2 pgoyette ${PROG}: ${PROG}.so 134 1.3.2.2 pgoyette ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ 135 1.3.2.2 pgoyette -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \ 136 1.3.2.2 pgoyette -j .reloc -O binary ${PROG}.so ${.TARGET} 137 1.3.2.2 pgoyette 138 1.3.2.2 pgoyette .include <bsd.prog.mk> 139 1.3.2.2 pgoyette 140 1.3.2.2 pgoyette ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot 141 1.3.2.2 pgoyette ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} 142 1.3.2.2 pgoyette @if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ 143 1.3.2.2 pgoyette (echo Undefined symbols; false); \ 144 1.3.2.2 pgoyette fi 145 1.3.2.2 pgoyette rm -f ${.TARGET} 146 1.3.2.2 pgoyette mv ${.TARGET}.tmp ${.TARGET} 147 1.3.2.2 pgoyette 148 1.3.2.2 pgoyette KLINK_MACHINE?= ${MACHINE} 149 1.3.2.2 pgoyette .include <bsd.klinks.mk> 150