1 # $NetBSD: Makefile,v 1.6 2017/12/23 06:48:30 ryoon 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 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 -Wstrict-prototypes 26 CFLAGS+= -mno-red-zone -mno-mmx -mno-sse -mno-avx -ffreestanding 27 STRIPFLAG= 28 LINKFLAGS= -X -z max-page-size=0x100000 -Ttext 0x100000 \ 29 -T ${S}/arch/amd64/stand/prekern/prekern.ldscript 30 31 KERN_AS= library 32 .include "${S}/lib/libkern/Makefile.inc" 33 LIBKERN= ${KERNLIB} 34 35 LIBCRT0= # nothing 36 LIBCRTI= # nothing 37 LIBC= # nothing 38 LIBCRTBEGIN= # nothing 39 LIBCRTEND= # nothing 40 41 ${PROG}: ${OBJS} ${LIBKERN} 42 ${_MKTARGET_LINK} 43 ${LD} ${LINKFLAGS} -o ${.TARGET} ${OBJS} ${LIBKERN} 44 45 all: ${PROG} 46 47 .include <bsd.prog.mk> 48 49 cleandir distclean: .WAIT cleanlibdir 50 51 cleanlibdir: 52 -rm -rf lib 53