Home | History | Annotate | Line # | Download | only in zboot
Makefile revision 1.8
      1 #	$NetBSD: Makefile,v 1.8 2012/01/18 23:12:21 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 SRCS+=		pathfs.c
     12 
     13 NOMAN=		# defined
     14 
     15 .include <bsd.own.mk>
     16 
     17 CFLAGS+=	-Wall -Wno-main
     18 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     19 CFLAGS+=	-fno-stack-protector -fno-builtin -ffreestanding
     20 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S}
     21 CPPFLAGS+=	-D_STANDALONE -DHEAP_VARIABLE
     22 CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
     23 AFLAGS+=	-D_LOCORE
     24 LDFLAGS+=	-nostdlib -Bstatic
     25 
     26 CLEANFILES+=	vers.c vers.o
     27 
     28 LIBCRT0=	crt0.o
     29 LIBC=		# nothing
     30 LIBCRTBEGIN=	# nothing
     31 LIBCRTEND=	# nothing
     32 
     33 NEWVERSWHAT?=   "Boot"
     34 VERSIONFILE?=	${.CURDIR}/version
     35 
     36 ### find out what to use for libkern
     37 KERN_AS=	library
     38 .include "${S}/lib/libkern/Makefile.inc"
     39 LIBKERN=	${KERNLIB}
     40 
     41 ### find out what to use for libz
     42 Z_AS=		library
     43 .include "${S}/lib/libz/Makefile.inc"
     44 LIBZ=		${ZLIB}
     45 
     46 ### find out what to use for libsa
     47 SA_AS=		library
     48 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_ENABLE_LS_OP=yes
     49 .include "${S}/lib/libsa/Makefile.inc"
     50 LIBSA=		${SALIB}
     51 
     52 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE}
     53 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     54 	    ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT}
     55 	${CC} -c vers.c
     56 	${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
     57 
     58 .include <bsd.klinks.mk>
     59 .include <bsd.prog.mk>
     60 
     61 cleandir distclean: .WAIT cleanlibdir
     62 
     63 cleanlibdir:
     64 	-rm -rf lib
     65 
     66 release: check_RELEASEDIR
     67 	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
     68 	    ${RELEASEDIR}/${MACHINE}/installation
     69