7f2d47d84c
Boot stuff dependencies from NetBSD. Patch by Antoine Leca. Relocated to src/sys. The port is using the same libminc.a as usual MINIX services (and does not use NetBSD libkern); the headers imported from NetBSD sys/ tree have been kept to a minimum (still numbers higher than 30 though.) Note the peculiar way to use libraries (libsa, libi386, etc.): the source code is shared, but each component builds its own copy of the library, with its own set of preprocessor defines.
64 lines
1.5 KiB
Makefile
64 lines
1.5 KiB
Makefile
# $NetBSD: Makefile,v 1.12 2011/05/20 22:29:55 joerg Exp $
|
|
|
|
AFLAGS.cdboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
|
|
|
|
NOMAN= # defined
|
|
.include <bsd.own.mk>
|
|
|
|
STRIPFLAG= # nothing
|
|
TOOL_SED?= sed
|
|
NM?= nm
|
|
|
|
LIBCRT0= # nothing
|
|
LIBCRTBEGIN= # nothing
|
|
LIBCRTEND= # nothing
|
|
LIBC= # nothing
|
|
|
|
PRIMARY_LOAD_ADDRESS= 0x1000
|
|
SECONDARY_LOAD_ADDRESS= 0x10000
|
|
|
|
PROG= bootxx_cd9660
|
|
SRCS?= cdboot.S
|
|
|
|
BINDIR= /usr/mdec
|
|
BINMODE= 444
|
|
|
|
.PATH: ${.CURDIR}/..
|
|
|
|
LDFLAGS+= -nostdlib -Wl,-e,start
|
|
CPPFLAGS+= -I. -I${.CURDIR}/../lib # -I${S}
|
|
CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS}
|
|
CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
|
|
CPPFLAGS+= -DDISABLE_KEYPRESS
|
|
|
|
.if ${MACHINE_ARCH} == "x86_64"
|
|
LDFLAGS+= -Wl,-m,elf_i386
|
|
AFLAGS+= -m32
|
|
.endif
|
|
|
|
.if defined(_NetBSD_)
|
|
# NetBSD can be compiled from a foreign host, MINIX do not. So commented out.
|
|
# Make sys/ a local thing for benefit of cross-compilers
|
|
S= ${.CURDIR}/../../../../..
|
|
CPPFLAGS+= -I${S}
|
|
# And same for machine/; need a bit more work because of symlink
|
|
BUILDSYMLINKS+= $S/arch/i386/include machine \
|
|
$S/arch/x86/include x86
|
|
DPSRCS+= machine x86
|
|
.endif
|
|
|
|
AFLAGS+= -Wa,--divide
|
|
|
|
CLEANFILES+= ${PROG}.tmp
|
|
|
|
${PROG}: ${OBJS}
|
|
${_MKTARGET_LINK}
|
|
${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \
|
|
${OBJS}
|
|
@ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'free_space' \
|
|
| ${TOOL_SED} 's/^0*//' ); \
|
|
echo "#### There are $$1 free bytes in ${PROG}"
|
|
${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
|
|
rm -f ${PROG}.tmp
|
|
|
|
.include <bsd.prog.mk>
|