1 # $NetBSD: Makefile.usermode,v 1.13 2011/08/22 21:45:38 jmcneill Exp $ 2 3 MACHINE_ARCH= usermode 4 USETOOLS?= no 5 NEED_OWN_INSTALL_TARGET?= no 6 .include <bsd.own.mk> 7 8 ## 9 ## (1) port identification 10 ## 11 USERMODE= $S/arch/usermode 12 GENASSYM_CONF= ${USERMODE}/usermode/genassym.cf 13 14 ## 15 ## (2) compile settings 16 ## 17 USERMODE_LIBS= -lrt 18 19 DEFCOPTS= -fno-omit-frame-pointer 20 CPPFLAGS+= -Dusermode 21 CPPFLAGS.init_main.c+= -Dmain=kernmain 22 23 CPPFLAGS.thunk.c+= -U_KERNEL -I/usr/include 24 25 ## 26 ## (3) libkern and compat 27 ## 28 KERN_AS= obj 29 COMPAT_AS= obj 30 31 ## 32 ## (4) local objects, compile rules, and dependencies 33 ## 34 MD_OBJS= thunk.o 35 MD_CFILES= ${USERMODE}/usermode/thunk.c 36 MD_SFILES= 37 38 ## 39 ## (5) link settings 40 ## 41 SYSTEM_LD= @${_MKSHMSG} " link ${.CURDIR:T}/${.TARGET}"; \ 42 ${_MKSHECHO}\ 43 ${CC} ${COPTS} -Wl,-Map,$@.map,-Bstatic -o $@ '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o ${USERMODE_LIBS}; \ 44 ${CC} ${COPTS} -Wl,-Map,$@.map,-Bstatic -o $@ ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o ${USERMODE_LIBS} 45 NVFLAGS= -n 46 47 ## 48 ## (6) port specific target dependencies 49 ## 50 51 .if !make(obj) && !make(clean) && !make(cleandir) 52 .BEGIN: 53 @rm -f i386 && \ 54 ln -s $S/arch/i386/include i386 55 .endif 56 57 thunk.o: ${USERMODE}/usermode/thunk.c 58 ${CC} ${CPPFLAGS.thunk.c} -c -o $@ ${USERMODE}/usermode/thunk.c 59 60 ## 61 ## (7) misc settings 62 ## 63 64 ## 65 ## (8) config(8) generated machinery 66 %INCLUDES 67 68 %OBJS 69 70 %CFILES 71 72 %SFILES 73 74 %LOAD 75 76 %RULES 77 78 ## 79 ## (9) port independent kernel machinery 80 ## 81 .include "$S/conf/Makefile.kern.inc" 82 83 ## 84 ## (10) appending make options 85 ## 86 %MAKEOPTIONSAPPEND 87