1 1.19.28.1 pgoyette # $NetBSD: Makefile.mbr,v 1.19.28.1 2018/06/25 07:25:43 pgoyette Exp $ 2 1.1 dsl 3 1.16 tsutsui S= ${.CURDIR}/../../../../.. 4 1.1 dsl 5 1.19.28.1 pgoyette NOSANITIZER= # defined 6 1.4 simonb NOMAN= # defined 7 1.4 simonb 8 1.4 simonb LIBCRT0= # nothing 9 1.19 tsutsui LIBCRTI= # nothing 10 1.4 simonb LIBCRTBEGIN= # nothing 11 1.4 simonb LIBCRTEND= # nothing 12 1.4 simonb LIBC= # nothing 13 1.1 dsl 14 1.13 christos PIE_CFLAGS= 15 1.13 christos PIE_LDFLAGS= 16 1.13 christos PIE_AFLAGS= 17 1.13 christos 18 1.1 dsl .include <bsd.own.mk> 19 1.1 dsl 20 1.5 uwe STRIPFLAG= # override 21 1.5 uwe 22 1.11 lukem SRCS?= mbr.S 23 1.1 dsl 24 1.11 lukem BINDIR= /usr/mdec 25 1.11 lukem BINMODE= 444 26 1.1 dsl 27 1.11 lukem .PATH: ${.CURDIR}/.. 28 1.1 dsl 29 1.11 lukem LDFLAGS+= -nostdlib -Wl,-e,start 30 1.11 lukem CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S} 31 1.1 dsl 32 1.15 abs .if ${MACHINE_ARCH} == "x86_64" 33 1.11 lukem LDFLAGS+= -Wl,-m,elf_i386 34 1.11 lukem AFLAGS+= -m32 35 1.1 dsl .endif 36 1.4 simonb 37 1.11 lukem BUILDSYMLINKS+= $S/arch/i386/include machine \ 38 1.11 lukem $S/arch/x86/include x86 39 1.4 simonb 40 1.10 lukem DPSRCS+= machine x86 41 1.1 dsl 42 1.11 lukem CLEANFILES+= ${PROG}.tmp 43 1.1 dsl 44 1.17 dsl LOADADDR= 0x8800 45 1.17 dsl 46 1.18 joerg AFLAGS.mbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} 47 1.18 joerg AFLAGS.gpt.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} 48 1.18 joerg 49 1.1 dsl ${PROG}: ${OBJS} 50 1.12 lukem ${_MKTARGET_LINK} 51 1.17 dsl ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS} 52 1.11 lukem @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' \ 53 1.14 apb | ${TOOL_SED} 's/^0*//' ); \ 54 1.3 hubertf echo "#### There are $$1 free bytes in ${PROG}" 55 1.1 dsl ${OBJCOPY} -O binary ${PROG}.tmp ${PROG} 56 1.1 dsl rm -f ${PROG}.tmp 57 1.1 dsl 58 1.1 dsl .include <bsd.prog.mk> 59