Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
# $NetBSD: Makefile.mbr,v 1.18 2011/05/20 15:05:02 joerg Exp $
|
|
|
|
|
|
|
|
S= ${.CURDIR}/../../../../..
|
2012-01-10 11:01:31 +01:00
|
|
|
|
|
|
|
NOMAN= # defined
|
|
|
|
|
|
|
|
LIBCRT0= # nothing
|
|
|
|
LIBCRTBEGIN= # nothing
|
|
|
|
LIBCRTEND= # nothing
|
|
|
|
LIBC= # nothing
|
|
|
|
|
|
|
|
PIE_CFLAGS=
|
|
|
|
PIE_LDFLAGS=
|
|
|
|
PIE_AFLAGS=
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
STRIPFLAG= # override
|
|
|
|
|
|
|
|
SRCS?= mbr.S
|
|
|
|
|
|
|
|
BINDIR= /usr/mdec
|
|
|
|
BINMODE= 444
|
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/..
|
|
|
|
|
|
|
|
LDFLAGS+= -nostdlib -Wl,-e,start
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
# MINIX LSC DO we need to remove the includes??
|
|
|
|
CPPFLAGS+= -I. -I${.CURDIR}/../../lib #-I${S}
|
|
|
|
CPPFLAGS+= -DLOADADDR=${LOADADDR}
|
2012-01-10 11:01:31 +01:00
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "x86_64"
|
|
|
|
LDFLAGS+= -Wl,-m,elf_i386
|
|
|
|
AFLAGS+= -m32
|
|
|
|
.endif
|
|
|
|
|
2012-01-10 17:43:33 +01:00
|
|
|
AFLAGS+= "-Wa,--divide"
|
2012-01-10 11:01:31 +01:00
|
|
|
|
2012-01-10 17:43:33 +01:00
|
|
|
# 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
|
2012-01-10 11:01:31 +01:00
|
|
|
|
|
|
|
CLEANFILES+= ${PROG}.tmp
|
|
|
|
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
LOADADDR= 0x8800
|
|
|
|
|
|
|
|
AFLAGS.mbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
|
|
|
|
AFLAGS.gpt.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
|
|
|
|
|
2012-01-10 11:01:31 +01:00
|
|
|
${PROG}: ${OBJS}
|
|
|
|
${_MKTARGET_LINK}
|
|
|
|
${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
|
2012-01-10 17:43:33 +01:00
|
|
|
@ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'mbr_space' \
|
2012-01-10 11:01:31 +01:00
|
|
|
| ${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>
|