Home | History | Annotate | Line # | Download | only in prekern
Makefile revision 1.2
      1 #	$NetBSD: Makefile,v 1.2 2017/11/13 20:03:26 maxv Exp $
      2 
      3 PROG=		prekern
      4 SRCS=	locore.S trap.S prekern.c mm.c console.c elf.c
      5 
      6 NOSSP=		# defined
      7 NOPIE=		# defined
      8 NOMAN=		1
      9 
     10 S=	${.CURDIR}/../../../..
     11 
     12 .PATH: ${.CURDIR}
     13 
     14 BINDIR=		/usr/mdec
     15 BINMODE=	444
     16 
     17 .include <bsd.own.mk>
     18 
     19 CPPFLAGS+=	-I. -I${S} -I${.OBJDIR} -I${.CURDIR}
     20 CPPFLAGS+=	-D_STANDALONE
     21 
     22 .include <bsd.klinks.mk>
     23 
     24 CPPFLAGS+=	-DKERNEL -D__x86_64__
     25 CFLAGS+=	-Wall -Werror -mno-red-zone -mno-mmx -mno-sse -mno-avx -ffreestanding
     26 STRIPFLAG=
     27 LINKFLAGS=	-X -z max-page-size=0x100000 -Ttext 0x100000 -T prekern.ldscript
     28 
     29 KERN_AS=	library
     30 .include	"${S}/lib/libkern/Makefile.inc"
     31 LIBKERN=	${KERNLIB}
     32 
     33 LIBCRT0=	# nothing
     34 LIBCRTI=	# nothing
     35 LIBC=		# nothing
     36 LIBCRTBEGIN=	# nothing
     37 LIBCRTEND=	# nothing
     38 
     39 ${PROG}: ${OBJS} ${LIBKERN}
     40 	${_MKTARGET_LINK}
     41 	${LD} ${LINKFLAGS} -o ${.TARGET} ${OBJS} ${LIBKERN}
     42 
     43 all:	${PROG}
     44 
     45 .include <bsd.prog.mk>
     46 
     47 cleandir distclean: .WAIT cleanlibdir
     48 
     49 cleanlibdir:
     50 	-rm -rf lib
     51