picobsd (215177) | picobsd (218359) |
---|---|
1#!/bin/sh - 2# | 1#!/bin/sh - 2# |
3# $FreeBSD: head/release/picobsd/build/picobsd 215177 2010-11-12 12:48:41Z luigi $ | 3# $FreeBSD: head/release/picobsd/build/picobsd 218359 2011-02-05 23:03:40Z luigi $ |
4# This file requires sysutils/makefs to run 5# 6# The PicoBSD build script. Invoked as 7# 8# picobsd [options] image_type [site_name] 9# 10# Where image_type is a directory with the picobsd config info, 11# and ${image_type}/floppy.tree.${site_name} contains --- 159 unchanged lines hidden (view full) --- 171 else 172 no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" 173 fi 174 MAKEOBJDIRPREFIX=${l_objtree} 175 export MAKEOBJDIRPREFIX 176 ( cd ${SRC}; 177 # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld 178 if [ -d "$1" ] ; then | 4# This file requires sysutils/makefs to run 5# 6# The PicoBSD build script. Invoked as 7# 8# picobsd [options] image_type [site_name] 9# 10# Where image_type is a directory with the picobsd config info, 11# and ${image_type}/floppy.tree.${site_name} contains --- 159 unchanged lines hidden (view full) --- 171 else 172 no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" 173 fi 174 MAKEOBJDIRPREFIX=${l_objtree} 175 export MAKEOBJDIRPREFIX 176 ( cd ${SRC}; 177 # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld 178 if [ -d "$1" ] ; then |
179 cd $1 ; ${BINMAKE} $2 # specific target, e.g. ld-elf.so | 179 cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so |
180 else | 180 else |
181 ${BINMAKE} _+_= $no toolchain _includes _libraries | 181 ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries |
182 fi 183 ) 184} 185 186# entry for 4.x and earlier trees 187create_includes_and_libraries() { 188 local e i 189 --- 257 unchanged lines hidden (view full) --- 447 448# invoke the picobsd Makefile to compile the kernel. 449# if MODULES is set (value is irrelevant) the makefile will build modules. 450do_kernel() { # OK 451 log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" 452 (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ; 453 # export CONFIG 454 [ "${o_do_modules}" = "yes" ] && export MODULES="" | 182 fi 183 ) 184} 185 186# entry for 4.x and earlier trees 187create_includes_and_libraries() { 188 local e i 189 --- 257 unchanged lines hidden (view full) --- 447 448# invoke the picobsd Makefile to compile the kernel. 449# if MODULES is set (value is irrelevant) the makefile will build modules. 450do_kernel() { # OK 451 log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" 452 (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ; 453 # export CONFIG 454 [ "${o_do_modules}" = "yes" ] && export MODULES="" |
455 ${BINMAKE} -v -f ${PICO_TREE}/build/Makefile.conf ) || \ | 455 ${BINMAKE} ${o_par} -v -f ${PICO_TREE}/build/Makefile.conf ) || \ |
456 fail $? missing_kernel 457} 458 459# Populate the variable part of the floppy filesystem. Must be done before 460# the MFS because its content might need to be copied there as well. 461# 462# This involves fetching files from three subtrees, in this order: 463# --- 512 unchanged lines hidden (view full) --- 976 l_objtree=${l_usrtree}/obj-pico 977 978 PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd} 979 set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` 980 OSVERSION=$3 981 log "OSVERSION is ${OSVERSION}" 982 if [ ${OSVERSION} -ge 500035 ] ; then 983 export MAKEOBJDIRPREFIX=${l_objtree} | 456 fail $? missing_kernel 457} 458 459# Populate the variable part of the floppy filesystem. Must be done before 460# the MFS because its content might need to be copied there as well. 461# 462# This involves fetching files from three subtrees, in this order: 463# --- 512 unchanged lines hidden (view full) --- 976 l_objtree=${l_usrtree}/obj-pico 977 978 PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd} 979 set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` 980 OSVERSION=$3 981 log "OSVERSION is ${OSVERSION}" 982 if [ ${OSVERSION} -ge 500035 ] ; then 983 export MAKEOBJDIRPREFIX=${l_objtree} |
984 export TARGET_ARCH=i386 TARGET=i386 |
|
984 eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" 985 eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` 986 fi 987 988 if [ "${o_init_src}" != "" ] ; then 989 if [ ${OSVERSION} -lt 500035 ] ; then 990 create_includes_and_libraries 991 else --- 23 unchanged lines hidden (view full) --- 1015 fi 1016 fi 1017} 1018 1019#------------------------------------------------------------------- 1020# Main entry of the script. Initialize variables, parse command line 1021# arguments. 1022 | 985 eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" 986 eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` 987 fi 988 989 if [ "${o_init_src}" != "" ] ; then 990 if [ ${OSVERSION} -lt 500035 ] ; then 991 create_includes_and_libraries 992 else --- 23 unchanged lines hidden (view full) --- 1016 fi 1017 fi 1018} 1019 1020#------------------------------------------------------------------- 1021# Main entry of the script. Initialize variables, parse command line 1022# arguments. 1023 |
1024# o_par="-j 8" # parallel make and other make options 1025 |
|
1023set_defaults 1024while [ true ]; do 1025 log "Parsing $1" 1026 case $1 in 1027 --src) # set the source path instead of /usr/src 1028 SRC=`realpath $2` 1029 shift 1030 ;; --- 76 unchanged lines hidden --- | 1026set_defaults 1027while [ true ]; do 1028 log "Parsing $1" 1029 case $1 in 1030 --src) # set the source path instead of /usr/src 1031 SRC=`realpath $2` 1032 shift 1033 ;; --- 76 unchanged lines hidden --- |