1 # $NetBSD: Makefile,v 1.8 2018/07/25 23:45:32 kamil 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 33 KERN_AS= library 34 .include "${S}/lib/libkern/Makefile.inc" 35 LIBKERN= ${KERNLIB} 36 37 LIBCRT0= # nothing 38 LIBCRTI= # nothing 39 LIBC= # nothing 40 LIBCRTBEGIN= # nothing 41 LIBCRTEND= # nothing 42 43 ${PROG}: ${OBJS} ${LIBKERN} 44 ${_MKTARGET_LINK} 45 ${LD} ${LINKFLAGS} -o ${.TARGET} ${OBJS} ${LIBKERN} 46 47 all: ${PROG} 48 49 .include <bsd.prog.mk> 50 51 cleandir distclean: .WAIT cleanlibdir 52 53 cleanlibdir: 54 -rm -rf lib 55