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