Home | History | Annotate | Line # | Download | only in boot
      1 #	$NetBSD: Makefile,v 1.33 2023/06/03 08:52:57 lukem Exp $
      2 
      3 NOMAN= # defined
      4 
      5 .include <bsd.own.mk>
      6 
      7 COMMON= ${.CURDIR}/../common
      8 COMMONOBJ!=	cd ${COMMON} && ${PRINTOBJDIR}
      9 
     10 .PATH: ${.CURDIR}/../boot ${COMMONOBJ}
     11 
     12 S= ${.CURDIR}/../../../..
     13 L= ${COMMONOBJ}/lib
     14 
     15 MKBOOTIMAGE= ${.CURDIR}/../../../powerpc/stand/mkbootimage
     16 
     17 BASE?=		boot
     18 PROG=		${BASE}
     19 NEWVERSWHAT=	"BOOT"
     20 
     21 SRCS= srt0.s
     22 SRCS+= boot.c clock.c com.c conf.c cons.c devopen.c
     23 SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
     24 SRCS+= kbd.c ns16550.c vreset.c vga.c 
     25 SRCS+= pci.c sd.c siop.c
     26 
     27 CFLAGS= -Os -ffreestanding
     28 CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
     29 AFLAGS= -x assembler-with-cpp
     30 
     31 CPPFLAGS= -nostdinc -I${.OBJDIR} -I${MKBOOTIMAGE} -I${S}
     32 CPPFLAGS+= -D_STANDALONE -DRELOC=${RELOC} -DUSE_SCAN
     33 CPPFLAGS+= -D__daddr_t=int32_t
     34 #CPPFLAGS+= -DDBMONITOR
     35 #CPPFLAGS+= -DSCSI_SUPPORT    # experimental
     36 
     37 .if (${BASE} == "boot")
     38 CPPFLAGS+= -DCONS_VGA -DVGA_RESET
     39 .elif (${BASE} == "boot_com0")
     40 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
     41 .elif (${BASE} == "boot_com0_vreset")
     42 CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8 -DVGA_RESET
     43 .endif
     44 
     45 STRIPFLAG=
     46 BINMODE= 444
     47 
     48 # XXX SHOULD NOT NEED TO DEFINE THESE!
     49 LIBCRT0=
     50 LIBCRTI=
     51 LIBC=
     52 LIBCRTBEGIN=
     53 LIBCRTEND=
     54 
     55 RELOC= 0x800000
     56 
     57 CLEANFILES+= machine powerpc ${PROG}.elf
     58 
     59 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
     60 
     61 ${PROG}: ${OBJS} ${LIBS}
     62 	${_MKTARGET_LINK}
     63 	${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \
     64 		-Ttext ${RELOC} ${OBJS} ${LIBS}
     65 	${STRIP} -o ${PROG} ${PROG}.elf
     66 
     67 .include "${S}/conf/newvers_stand.mk"
     68 
     69 CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
     70 
     71 .include <bsd.prog.mk>
     72 .include <bsd.klinks.mk>
     73