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