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