2011-01-22 22:19:14 +03:00
|
|
|
# $NetBSD: Makefile,v 1.31 2011/01/22 19:19:16 joerg Exp $
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
NOMAN= # defined
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
.include <bsd.own.mk>
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
COMMON= ${.CURDIR}/../common
|
|
|
|
COMMONOBJ!= cd ${COMMON} && ${PRINTOBJDIR}
|
2004-11-25 11:09:14 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
.PATH: ${.CURDIR}/../boot ${COMMONOBJ} ${.CURDIR}/../../../powerpc/powerpc
|
2004-11-25 11:09:14 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
S= ${.CURDIR}/../../../..
|
|
|
|
L= ${COMMONOBJ}/lib
|
2004-11-25 11:09:14 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
ELF2PEF= ${.CURDIR}/../../../powerpc/stand/mkbootimage
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
COMMONLIBDIR= ${.CURDIR}/../../../../../common
|
2004-11-25 11:09:14 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
BASE?= boot
|
|
|
|
PROG= ${BASE}
|
|
|
|
NEWVERSWHAT= "BOOT"
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
SRCS= srt0.s
|
|
|
|
SRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
|
|
|
|
SRCS+= fd.c filesystem.c inkernel.c io.c kbd.c monitor.c ns16550.c
|
2010-10-14 10:58:22 +04:00
|
|
|
SRCS+= pci.c prf.c sd.c siop.c tgets.c vers.c vga.c video.c vreset.c wdc.c wd.c
|
2008-05-26 20:28:39 +04:00
|
|
|
SRCS+= setjmp.S
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
CFLAGS= -Wno-main -ffreestanding
|
2011-01-21 18:59:04 +03:00
|
|
|
AFLAGS= -x assembler-with-cpp
|
2008-05-26 20:28:39 +04:00
|
|
|
|
2010-10-14 09:40:40 +04:00
|
|
|
CPPFLAGS= -nostdinc
|
|
|
|
CPPFLAGS+= -I${.OBJDIR} -I${S} -I${COMMONLIBDIR}/include -I${S}/lib/libsa
|
|
|
|
CPPFLAGS+= -I${ELF2PEF}
|
2008-05-26 20:28:39 +04:00
|
|
|
CPPFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
CPPFLAGS+= -D_STANDALONE -DRELOC=${RELOC} -DUSE_SCAN
|
|
|
|
CPPFLAGS+= -D__daddr_t=int32_t
|
|
|
|
#CPPFLAGS+= -DDBMONITOR
|
|
|
|
|
|
|
|
.if (${BASE} == "boot")
|
|
|
|
CPPFLAGS+= -DCONS_BE
|
|
|
|
.elif (${BASE} == "boot_com0")
|
|
|
|
CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
|
|
|
|
.elif (${BASE} == "boot_vga")
|
|
|
|
CPPFLAGS+= -DCONS_VGA
|
|
|
|
.endif
|
|
|
|
|
1998-01-16 07:07:35 +03:00
|
|
|
STRIPFLAG=
|
|
|
|
BINMODE= 444
|
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
# XXX SHOULD NOT NEED TO DEFINE THESE!
|
|
|
|
LIBCRT0=
|
|
|
|
LIBC=
|
|
|
|
LIBCRTBEGIN=
|
|
|
|
LIBCRTEND=
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
RELOC= 0x700000
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
CLEANFILES+= vers.c machine powerpc ${PROG}.elf
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
.if !make(obj) && !make(clean) && !make(cleandir)
|
|
|
|
.BEGIN: machine powerpc
|
|
|
|
.NOPATH: machine powerpc
|
1998-01-16 07:07:35 +03:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
machine::
|
|
|
|
-rm -f $@
|
|
|
|
ln -s ${S}/arch/${MACHINE}/include $@
|
1999-06-24 05:10:31 +04:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
powerpc::
|
|
|
|
-rm -f $@
|
|
|
|
ln -s ${S}/arch/powerpc/include $@
|
|
|
|
.endif
|
1999-06-24 05:10:31 +04:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
vers.c: ${.CURDIR}/../boot/version
|
2011-01-22 22:19:14 +03:00
|
|
|
${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
|
|
|
|
${.CURDIR}/../boot/version "bebox" ${NEWVERSWHAT}
|
2002-04-08 20:09:58 +04:00
|
|
|
|
2008-05-26 20:28:39 +04:00
|
|
|
${PROG}: ${OBJS} ${LIBS}
|
|
|
|
${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \
|
|
|
|
-Ttext ${RELOC} ${OBJS} ${LIBS}
|
|
|
|
${STRIP} -o ${PROG} ${PROG}.elf
|
1998-01-16 07:07:35 +03:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|