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.i386

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.i386 -- with config changes.
    2 # Copyright 1990 W. Jolitz
    3 #       from: @(#)Makefile.i386 7.1 5/10/91
    4 # $FreeBSD$
    5 #
    6 # Makefile for FreeBSD
    7 #
    8 # This makefile is constructed from a machine description:
    9 #       config machineid
   10 # Most changes should be made in the machine description
   11 #       /sys/i386/conf/``machineid''
   12 # after which you should do
   13 #        config machineid
   14 # Generic makefile changes should be made in
   15 #       /sys/conf/Makefile.i386
   16 # after which config should be rerun for all machines.
   17 #
   18 
   19 # Which version of config(8) is required.
   20 %VERSREQ=       400019
   21 
   22 # Can be overridden by makeoptions or /etc/make.conf
   23 KERNEL?=        kernel
   24 STD8X16FONT?=   iso
   25 
   26 .if !defined(S)
   27 .if exists(./@/.)
   28 S=      ./@
   29 .else
   30 S=      ../..
   31 .endif
   32 .endif
   33 M=      ${MACHINE_ARCH}
   34 
   35 SIZE?=          size
   36 OBJCOPY?=       objcopy
   37 
   38 COPTFLAGS?=-O -pipe
   39 .if !defined(NO_CPU_COPTFLAGS)
   40 COPTFLAGS+= ${_CPUCFLAGS}
   41 .endif
   42 INCLUDES= -nostdinc -I- -I. -I$S
   43 # This hack is to allow kernel compiles to succeed on machines w/out srcdist
   44 .if exists($S/../include)
   45 INCLUDES+= -I$S/../include
   46 .else
   47 INCLUDES+= -I/usr/include
   48 .endif
   49 
   50 # This hack lets us use the Intel ACPICA code without spamming a new 
   51 # include path into 100+ source files.
   52 INCLUDES+= -I$S/contrib/dev/acpica
   53 
   54 # This hack lets us use the ipfilter code without spamming a new
   55 # include path into 100+ source files.
   56 INCLUDES+= -I$S/contrib/ipfilter
   57 
   58 COPTS=  ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h
   59 CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
   60 
   61 # XXX LOCORE means "don't declare C stuff" not "for locore.s".
   62 ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
   63 
   64 DEFINED_PROF=   ${PROF}
   65 .if defined(PROF)
   66 CFLAGS+=        -malign-functions=4
   67 .if ${PROFLEVEL} >= 2
   68 IDENT+= -DGPROF4 -DGUPROF
   69 PROF+=  -mprofiler-epilogue
   70 .endif
   71 .endif
   72 
   73 # Put configuration-specific C flags last (except for ${PROF}) so that they
   74 # can override the others.
   75 CFLAGS+=        ${CONF_CFLAGS}
   76 
   77 NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
   78 NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
   79 NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${.IMPSRC}
   80 PROFILE_C= ${CC} -c ${CFLAGS} ${.IMPSRC}
   81 
   82 GEN_CFILES= $S/$M/$M/genassym.c
   83 # setdef0.c and setdef1.c are intentionally
   84 # omitted from SYSTEM_CFILES.  They include setdefs.h, a header which
   85 # is generated from all of ${OBJS}.  We don't want to have to compile
   86 # everything just to do a make depend.
   87 SYSTEM_CFILES= ioconf.c vnode_if.c config.c
   88 SYSTEM_SFILES= $S/$M/$M/locore.s
   89 SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
   90 SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o config.o \
   91         setdef1.o hack.So
   92 SYSTEM_LD= @${LD} -Bdynamic -T $S/conf/ldscript.$M \
   93         -export-dynamic -dynamic-linker /red/herring \
   94         -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
   95 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
   96         ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
   97 SYSTEM_DEP+= $S/conf/ldscript.$M
   98 
   99 %BEFORE_DEPEND
  100 
  101 %OBJS
  102 
  103 %CFILES
  104 
  105 %SFILES
  106 
  107 %MFILES
  108 
  109 %CLEAN
  110 
  111 .PHONY: all modules
  112 
  113 all: ${KERNEL}
  114 
  115 depend: kernel-depend
  116 clean:  kernel-clean
  117 cleandepend:  kernel-cleandepend
  118 tags:  kernel-tags
  119 install install.debug: kernel-install
  120 reinstall reinstall.debug: kernel-reinstall
  121 
  122 .if !defined(DEBUG)
  123 FULLKERNEL=     ${KERNEL}
  124 .else
  125 FULLKERNEL=     ${KERNEL}.debug
  126 ${KERNEL}: ${FULLKERNEL}
  127         ${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL}
  128 .endif
  129 
  130 ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
  131         @rm -f ${.TARGET}
  132         @echo linking ${.TARGET}
  133         ${SYSTEM_LD}
  134         ${SYSTEM_LD_TAIL}
  135 
  136 .if !exists(.depend)
  137 ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h}
  138 .endif
  139 
  140 kernel-clean:
  141         rm -f *.o *.so *.So *.ko *.s eddep errs \
  142               ${FULLKERNEL} ${KERNEL} linterrs makelinks \
  143               setdef[01].c setdefs.h tags \
  144               vers.c vnode_if.c vnode_if.h ${CLEAN}
  145 
  146 #lint: /tmp
  147 #       @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} \
  148 #         $S/$M/$M/Locore.c ${CFILES} ioconf.c | \
  149 #           grep -v 'struct/union .* never defined' | \
  150 #           grep -v 'possible pointer alignment problem'
  151 
  152 locore.o: $S/$M/$M/locore.s assym.s
  153         ${NORMAL_S}
  154 
  155 # This is a hack.  BFD "optimizes" away dynamic mode if there are no
  156 # dynamic references.  We could probably do a '-Bforcedynamic' mode like
  157 # in the a.out ld.  For now, this works.
  158 hack.So: Makefile
  159         touch hack.c
  160         ${CC} -shared -nostdlib hack.c -o hack.So
  161         rm -f hack.c
  162 
  163 .ORDER: setdefs.h setdef0.c setdef1.c
  164 
  165 setdef0.o: setdef0.c setdefs.h
  166         ${NORMAL_C}
  167 
  168 setdef1.o: setdef1.c setdefs.h
  169         ${NORMAL_C}
  170 
  171 setdef0.c setdef1.c setdefs.h: ${OBJS}
  172         @gensetdefs ${OBJS}
  173 
  174 # this rule stops ./assym.s in .depend from causing problems
  175 ./assym.s: assym.s
  176 
  177 assym.s: $S/kern/genassym.sh genassym.o
  178         sh $S/kern/genassym.sh genassym.o > ${.TARGET}
  179 
  180 genassym.o: $S/$M/$M/genassym.c
  181         ${CC} -c ${CFLAGS} $S/$M/$M/genassym.c
  182 
  183 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
  184 
  185 # The argument list can be very long, use make -V and xargs to
  186 # pass it to mkdep.
  187 kernel-depend: assym.s vnode_if.h ${BEFORE_DEPEND} \
  188             ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} ${SYSTEM_SFILES}
  189         rm -f .newdep
  190         ${MAKE} -V CFILES -V SYSTEM_CFILES -V GEN_CFILES | xargs \
  191                 mkdep -a -f .newdep ${CFLAGS}
  192         ${MAKE} -V SFILES -V SYSTEM_SFILES | xargs \
  193             env MKDEP_CPP="${CC} -E" mkdep -a -f .newdep ${ASM_CFLAGS}
  194         rm -f .depend
  195         mv -f .newdep .depend
  196 
  197 kernel-cleandepend:
  198         rm -f .depend
  199 
  200 links:
  201         egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
  202           sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
  203         ${MAKE} -V CFILES | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
  204           sort -u | comm -23 - dontlink | \
  205           sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
  206         sh makelinks && rm -f dontlink
  207 
  208 kernel-tags:
  209         @[ -f .depend ] || { echo "you must make depend first"; exit 1; }
  210         sh $S/conf/systags.sh
  211         rm -f tags1
  212         sed -e 's,      ../,    ,' tags > tags1
  213 
  214 kernel-install kernel-install.debug:
  215         @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \
  216                 echo "You must build a kernel first." ; \
  217                 exit 1 ; \
  218         fi
  219 .if exists(${DESTDIR}/${KERNEL})
  220         -chflags noschg ${DESTDIR}/${KERNEL}
  221         mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old
  222 .endif
  223         ${INSTALL} -m 555 -o root -g wheel -fschg \
  224                 ${KERNEL}${.TARGET:S/kernel-install//} ${DESTDIR}/${KERNEL}
  225 
  226 kernel-reinstall kernel-reinstall.debug:
  227         ${INSTALL} -m 555 -o root -g wheel -fschg \
  228                 ${KERNEL}${.TARGET:S/kernel-reinstall//} ${DESTDIR}/${KERNEL}
  229 
  230 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules)
  231 all:    modules
  232 depend: modules-depend
  233 clean:  modules-clean
  234 cleandepend:  modules-cleandepend
  235 cleandir:  modules-cleandir
  236 tags:  modules-tags
  237 install install.debug: modules-install
  238 reinstall reinstall.debug: modules-reinstall
  239 .endif
  240 
  241 MKMODULESENV=   MAKEOBJDIRPREFIX=${.OBJDIR}/modules
  242 MKMODULESENV+=  COPTS="-include ${.OBJDIR}/opt_global.h"
  243 .if defined(MODULES_OVERRIDE)
  244 MKMODULESENV+=  MODULES_OVERRIDE="${MODULES_OVERRIDE}"
  245 .endif
  246 .if defined(DEBUG)
  247 MKMODULESENV+=  DEBUG="${DEBUG}" DEBUG_FLAGS="${DEBUG}"
  248 .endif
  249 MKMODULESENV+= MACHINE=i386
  250 
  251 modules:
  252         @mkdir -p ${.OBJDIR}/modules
  253         cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \
  254             env ${MKMODULESENV} ${MAKE} all
  255 
  256 modules-depend:
  257         @mkdir -p ${.OBJDIR}/modules
  258         cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \
  259             env ${MKMODULESENV} ${MAKE} depend
  260 
  261 modules-clean:
  262         cd $S/modules ; env ${MKMODULESENV} ${MAKE} clean
  263 
  264 modules-cleandepend:
  265         cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandepend
  266 
  267 modules-clobber:        modules-clean
  268         rm -rf ${MKMODULESENV}
  269 
  270 modules-cleandir:
  271         cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandir
  272 
  273 modules-tags:
  274         cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags
  275 
  276 modules-install modules-install.debug:
  277 .if !defined(NO_MODULES_OLD)
  278         if [ -d ${DESTDIR}/modules -a -n "`ls ${DESTDIR}/modules`" ]; then \
  279                 mkdir -p ${DESTDIR}/modules.old; \
  280                 cp -p ${DESTDIR}/modules/* ${DESTDIR}/modules.old; \
  281         fi;
  282 .endif
  283         cd $S/modules ; env ${MKMODULESENV} ${MAKE} install
  284 
  285 modules-reinstall modules-reinstall.debug:
  286         cd $S/modules ; env ${MKMODULESENV} ${MAKE} install
  287 
  288 config.o:
  289         ${NORMAL_C}
  290 
  291 ioconf.o:
  292         ${NORMAL_C}
  293 
  294 vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
  295         sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
  296 
  297 # XXX strictly, everything depends on Makefile because changes to ${PROF}
  298 # only appear there, but we don't handle that.
  299 vers.o:
  300         ${NORMAL_C}
  301 
  302 vnode_if.c: $S/kern/vnode_if.pl $S/kern/vnode_if.src
  303         perl5 $S/kern/vnode_if.pl -c $S/kern/vnode_if.src
  304 
  305 vnode_if.h: $S/kern/vnode_if.pl $S/kern/vnode_if.src
  306         perl5 $S/kern/vnode_if.pl -h $S/kern/vnode_if.src
  307 
  308 vnode_if.o:
  309         ${NORMAL_C}
  310 
  311 # Commented out for now pending a better solution.
  312 # How do we pick up compiler version specific flags??
  313 #.if exists($S/../share/mk)
  314 #.include "$S/../share/mk/bsd.kern.mk"
  315 #.else
  316 .include <bsd.kern.mk>
  317 #.endif
  318 
  319 %RULES
  320 
  321 # DO NOT DELETE THIS LINE -- make depend uses it

Cache object: 0b78cca6f8c114051c53024a52266b91


[ 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.