Home | History | Annotate | Line # | Download | only in zboot
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 2009/03/02 09:33:02 nonaka Exp $
      2 
      3 PROG=		zboot
      4 
      5 S=		${.CURDIR}/../../../..
      6 
      7 SRCS=		crt0.c
      8 SRCS+=		boot.c bootinfo.c bootmenu.c conf.c devopen.c diskprobe.c
      9 SRCS+=		loadfile_zboot.c
     10 SRCS+=		getsecs.c termios.c unixcons.c unixdev.c unixsys.S
     11 
     12 NOMAN=		# defined
     13 
     14 CFLAGS+=	-Wall -Wno-main
     15 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     16 CFLAGS+=	-fno-stack-protector -fno-builtin -ffreestanding
     17 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S}
     18 CPPFLAGS+=	-D_STANDALONE -DHEAP_VARIABLE
     19 AFLAGS+=	-D_LOCORE
     20 LDFLAGS+=	-nostdlib -Bstatic
     21 
     22 CLEANFILES+=	vers.c vers.o
     23 
     24 LIBCRT0=	crt0.o
     25 LIBC=		# nothing
     26 LIBCRTBEGIN=	# nothing
     27 LIBCRTEND=	# nothing
     28 
     29 NEWVERSWHAT?=   "Boot"
     30 VERSIONFILE?=	${.CURDIR}/version
     31 
     32 .if !make(obj) && !make(clean) && !make(cleandir) && !make(release)
     33 .BEGIN: machine arm
     34 .NOPATH: machine arm
     35 
     36 machine::
     37 	-rm -f $@
     38 	ln -s ${S}/arch/${MACHINE}/include $@
     39 
     40 arm::
     41 	-rm -f $@
     42 	ln -s ${S}/arch/arm/include $@
     43 .endif
     44 CLEANFILES+=	machine arm
     45 
     46 ### find out what to use for libkern
     47 KERN_AS=		library
     48 .include "${S}/lib/libkern/Makefile.inc"
     49 LIBKERN=	${KERNLIB}
     50 
     51 ### find out what to use for libz
     52 Z_AS=		library
     53 .include "${S}/lib/libz/Makefile.inc"
     54 LIBZ=		${ZLIB}
     55 
     56 ### find out what to use for libsa
     57 SA_AS=		library
     58 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     59 .include "${S}/lib/libsa/Makefile.inc"
     60 LIBSA=		${SALIB}
     61 
     62 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     63 	${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT}
     64 	${CC} -c vers.c
     65 	${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
     66 
     67 .include <bsd.prog.mk>
     68 
     69 cleandir distclean: cleanlibdir
     70 
     71 cleanlibdir:
     72 	-rm -rf lib
     73 
     74 release: check_RELEASEDIR
     75 	${HOST_INSTALL_FILE} -m ${BINMODE} ${OBJS} \
     76 	    ${RELEASEDIR}/${MACHINE}/installation
     77