The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/conf/Makefile.mips

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # Makefile.mips
    2 # $FreeBSD: releng/8.3/sys/conf/Makefile.mips 215938 2010-11-27 12:26:40Z jchandra $
    3 #
    4 # Makefile for FreeBSD
    5 #
    6 # This makefile is constructed from a machine description:
    7 #       config machineid
    8 # Most changes should be made in the machine description
    9 #       /sys/mips/conf/``machineid''
   10 # after which you should do
   11 #        config machineid
   12 # Generic makefile changes should be made in
   13 #       /sys/conf/Makefile.mips
   14 # after which config should be rerun for all machines.
   15 #
   16 
   17 # Which version of config(8) is required.
   18 %VERSREQ=       600004
   19 
   20 STD8X16FONT?=   iso
   21 
   22 .if !defined(S)
   23 .if exists(./@/.)
   24 S=      ./@
   25 .else
   26 S=      ../../..
   27 .endif
   28 .endif
   29 .include "$S/conf/kern.pre.mk"
   30 
   31 LDSCRIPT_NAME?=ldscript.$M
   32 SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
   33 SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
   34 
   35 # XXX: Such sweeping assumptions...
   36 MACHINE=mips
   37 MACHINE_ARCH=mips
   38 KERNLOADADDR?=0x80001000
   39 # This obscure value is defined by CFE for WR160N
   40 # To be changed later
   41 TRAMPLOADADDR?=0x807963c0
   42 
   43 MKMODULESENV+=  MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
   44 
   45 # We default to the MIPS32 ISA, if none specified in the
   46 # kernel configuration file.
   47 ARCH_FLAGS?=-march=mips32
   48 EXTRA_FLAGS=-fno-pic -mno-abicalls -G0
   49 
   50 HACK_EXTRA_FLAGS=-shared
   51 .if defined(TARGET_BIG_ENDIAN)
   52 CFLAGS+=-EB
   53 SYSTEM_LD+=-EB
   54 EXTRA_FLAGS+=-EB 
   55 TRAMP_LDFLAGS+=-Wl,-EB 
   56 HACK_EXTRA_FLAGS+=-EB -Wl,-EB
   57 .else
   58 CFLAGS+=-EL
   59 SYSTEM_LD+=-EL
   60 EXTRA_FLAGS+=-EL
   61 TRAMP_LDFLAGS+=-Wl,-EL
   62 HACK_EXTRA_FLAGS+=-EL -Wl,-EL
   63 .endif
   64 
   65 
   66 # We add the -fno-pic flag to kernels because otherwise performance
   67 # is extremely poor, as well as -mno-abicalls to force no ABI usage.
   68 CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
   69 HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
   70 
   71 # XXX hardcoded kernel entry point
   72 ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
   73 
   74 KERNEL_EXTRA=trampoline
   75 trampoline: ${KERNEL_KO}.tramp.bin
   76 ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \
   77         $S/$M/$M/inckern.S 
   78         ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
   79         -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
   80         sed s/${KERNLOADADDR}/${TRAMPLOADADDR}/ ${LDSCRIPT_NAME} | \
   81                 sed s/" + SIZEOF_HEADERS"//  > ${LDSCRIPT_NAME}.tramp.noheader
   82         # Generate .S file that setups stack and jumps to trampoline
   83         echo "#include <machine/asm.h>" >tmphack.S
   84         echo "ENTRY(_start)" >>tmphack.S
   85         echo "PTR_LA t0, kernel_end" >>tmphack.S
   86         echo "move sp, t0" >>tmphack.S
   87         echo "add sp, 0x2000" >>tmphack.S
   88         echo "and sp, ~0x7" >>tmphack.S
   89         echo "PTR_LA t0, _startC" >>tmphack.S
   90         echo "j t0" >>tmphack.S
   91         echo "END(_start)" >>tmphack.S
   92         echo "#define KERNNAME \"${KERNEL_KO}.tmp\""  >opt_kernname.h 
   93         ${CC} -O -nostdlib -I. -I$S ${HACK_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \
   94                 -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader tmphack.S \
   95                 $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
   96                 -o ${KERNEL_KO}.tramp.noheader 
   97         ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
   98                 ${KERNEL_KO}.tramp.bin \
   99 
  100 %BEFORE_DEPEND
  101 
  102 %OBJS
  103 
  104 %FILES.c
  105 
  106 %FILES.s
  107 
  108 %FILES.m
  109 
  110 %CLEAN
  111 
  112 CLEAN+= ${LDSCRIPT_NAME} ${LDSCRIPT_NAME}.tramp.noheader \
  113         ${KERNEL_KO}.tramp.noheader ${KERNEL_KO}.tramp.bin
  114 
  115 ${LDSCRIPT_NAME}: $S/conf/${LDSCRIPT_NAME}
  116         cat $S/conf/${LDSCRIPT_NAME}|sed s/KERNLOADADDR/${KERNLOADADDR}/g \
  117                 > ${LDSCRIPT_NAME}
  118 %RULES
  119 
  120 .include "$S/conf/kern.post.mk"

Cache object: f7df062b826617bec4814d56a1038808


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.