4 # Copyright (c) 2013 Hans Petter Selasky.
5 # Copyright (c) 2014 SRI International
8 # This software was developed by SRI International and the University of
9 # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
10 # ("CTSRD"), as part of the DARPA CRASH research programme.
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions
15 # 1. Redistributions of source code must retain the above copyright
16 # notice, this list of conditions and the following disclaimer.
17 # 2. Redistributions in binary form must reproduce the above copyright
18 # notice, this list of conditions and the following disclaimer in the
19 # documentation and/or other materials provided with the distribution.
21 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 KSHIM_DIR:= ${.PARSEDIR}
37 CFLAGS+= -I${KSHIM_DIR}
38 CFLAGS+= -I${KSHIM_DIR}/../..
39 CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE=\"bsd_global.h\"
40 CFLAGS+= -DHAVE_ENDIAN_DEFS
43 # Single threaded BSD kernel
48 # BUSSPACE implementation
50 KSRCS+= bsd_busspace.c
53 SRCS+= sysuninit_data.c
55 CLEANFILES+= sysinit.bin
56 CLEANFILES+= sysinit_data.c
57 CLEANFILES+= sysuninit_data.c
60 SYSINIT_OBJS= ${KSRCS:R:C/$/.osys/}
61 CLEANFILES+= ${SYSINIT_OBJS}
64 # SYSINIT() and SYSUNINIT() handling
67 sysinit_data.c: sysinit.bin
68 sysinit -i sysinit.bin -o ${.TARGET} -k sysinit -s sysinit_data
70 sysuninit_data.c: sysinit.bin
71 sysinit -i sysinit.bin -o ${.TARGET} -R -k sysuninit -s sysuninit_data
73 .for KSRC in ${KSRCS:R}
74 ${KSRC}.osys: ${KSRC}.o
75 ${OBJCOPY} -j ".debug.sysinit" -O binary ${KSRC}.o ${KSRC}.osys
78 sysinit.bin: ${SYSINIT_OBJS}
79 cat ${.ALLSRC} > sysinit.bin