Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.19
      1 #	$NetBSD: Makefile,v 1.19 2003/10/26 07:25:36 lukem 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. -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 .if !make(obj) && !make(clean) && !make(cleandir)
     36 .BEGIN:
     37 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     38 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     39 .endif
     40 .NOPATH: machine powerpc
     41 CLEANFILES+= machine powerpc
     42 
     43 ### find out what to use for libkern
     44 KERN_AS=	library
     45 .include "${S}/lib/libkern/Makefile.inc"
     46 LIBKERN=	${KERNLIB}
     47 
     48 ### find out what to use for libz
     49 Z_AS=		library
     50 .include "${S}/lib/libz/Makefile.inc"
     51 LIBZ=		${ZLIB}
     52 
     53 ### find out what to use for libsa
     54 SA_AS=		library
     55 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     56 .include "${S}/lib/libsa/Makefile.inc"
     57 LIBSA=		${SALIB}
     58 
     59 .PHONY: vers.c
     60 vers.c: version
     61 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "bebox" ${NEWVERSWHAT}
     62 
     63 realall: ${BOOTPROG}
     64 
     65 ${BOOTPROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} vers.o
     66 	${LD} -o ${BOOTPROG} -s -N -T ${.CURDIR}/ld.script -Ttext ${RELOC} ${OBJS} \
     67 		${LIBSA} ${LIBZ} ${LIBKERN} vers.o
     68 
     69 cleandir distclean: cleanlibdir
     70 
     71 cleanlibdir:
     72 	rm -rf lib
     73 
     74 .include <bsd.prog.mk>
     75