Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.17
      1 #	$NetBSD: Makefile,v 1.17 2003/10/08 01:36:19 simonb Exp $
      2 
      3 S= ${.CURDIR}/../../../..
      4 
      5 BOOTPROG= boot
      6 NEWVERSWHAT= "BOOT"
      7 
      8 ASRCS+= srt0.s
      9 CSRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
     10 CSRCS+= fd.c filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
     11 CSRCS+= kbd.c ns16550.c vreset.c vga.c video.c
     12 
     13 CLEANFILES+= vers.c vers.o ${BOOTPROG}
     14 
     15 COPTS+= -ffreestanding
     16 CPPFLAGS= -I${.CURDIR} -I${.CURDIR}/../elf2pef -I${.CURDIR}/../../..
     17 CPPFLAGS+= -I${S} -I${S}/lib/libsa
     18 CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC}
     19 CPPFLAGS+= -DUSE_SCAN
     20 #CPPFLAGS+= -DCONS_BE
     21 CPPFLAGS+= -DCONS_VGA
     22 #CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3F8
     23 
     24 AOBJS=	${ASRCS:.s=.o}
     25 COBJS=	${CSRCS:.c=.o}
     26 OBJS=	${AOBJS} ${COBJS}
     27 CFLAGS= -Wno-main
     28 AFLAGS= -x assembler-with-cpp -traditional-cpp
     29 NOMAN=	# defined
     30 STRIPFLAG=
     31 BINMODE= 444
     32 
     33 RELOC= 0x700000
     34 
     35 .BEGIN:
     36 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     37 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     38 .NOPATH: machine powerpc
     39 CLEANFILES+= machine powerpc
     40 
     41 ### find out what to use for libkern
     42 KERN_AS=	library
     43 .include "${S}/lib/libkern/Makefile.inc"
     44 LIBKERN=	${KERNLIB}
     45 
     46 ### find out what to use for libz
     47 Z_AS=		library
     48 .include "${S}/lib/libz/Makefile.inc"
     49 LIBZ=		${ZLIB}
     50 
     51 ### find out what to use for libsa
     52 SA_AS=		library
     53 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     54 .include "${S}/lib/libsa/Makefile.inc"
     55 LIBSA=		${SALIB}
     56 
     57 .PHONY: vers.c
     58 vers.c: version
     59 	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "bebox" ${NEWVERSWHAT}
     60 
     61 realall: ${BOOTPROG}
     62 
     63 ${BOOTPROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} vers.o
     64 	${LD} -o ${BOOTPROG} -s -N -T ${.CURDIR}/ld.script -Ttext ${RELOC} ${OBJS} \
     65 		${LIBSA} ${LIBZ} ${LIBKERN} vers.o
     66 
     67 cleandir distclean: cleanlibdir
     68 
     69 cleanlibdir:
     70 	rm -rf lib
     71 
     72 .include <bsd.prog.mk>
     73