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