Home | History | Annotate | Line # | Download | only in zboot
Makefile revision 1.6
      1 #	$NetBSD: Makefile,v 1.6 2011/01/23 13:17:02 joerg 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 AFLAGS+=	-D_LOCORE
     22 LDFLAGS+=	-nostdlib -Bstatic
     23 
     24 CLEANFILES+=	vers.c vers.o
     25 
     26 LIBCRT0=	crt0.o
     27 LIBC=		# nothing
     28 LIBCRTBEGIN=	# nothing
     29 LIBCRTEND=	# nothing
     30 
     31 NEWVERSWHAT?=   "Boot"
     32 VERSIONFILE?=	${.CURDIR}/version
     33 
     34 ### find out what to use for libkern
     35 KERN_AS=		library
     36 .include "${S}/lib/libkern/Makefile.inc"
     37 LIBKERN=	${KERNLIB}
     38 
     39 ### find out what to use for libz
     40 Z_AS=		library
     41 .include "${S}/lib/libz/Makefile.inc"
     42 LIBZ=		${ZLIB}
     43 
     44 ### find out what to use for libsa
     45 SA_AS=		library
     46 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     47 .include "${S}/lib/libsa/Makefile.inc"
     48 LIBSA=		${SALIB}
     49 
     50 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     51 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     52 	    ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT}
     53 	${CC} -c vers.c
     54 	${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
     55 
     56 .include <bsd.klinks.mk>
     57 .include <bsd.prog.mk>
     58 
     59 cleandir distclean: .WAIT cleanlibdir
     60 
     61 cleanlibdir:
     62 	-rm -rf lib
     63 
     64 release: check_RELEASEDIR
     65 	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
     66 	    ${RELEASEDIR}/${MACHINE}/installation
     67