ACPI - Fix type-o which caused clock interrupts to stop working properly in C3.
[dragonfly.git] / Makefile.inc1
index 1e448f9..dd0f629 100644 (file)
@@ -11,7 +11,6 @@
 # realquickworld - skip the glue and depend stages and just build the meat
 # crossworld  - only build the glue (particularly the cross-build environment)
 # installworld- install everything built by "buildworld"
-# update      - convenient way to update your source tree (eg: sup/cvs)
 # most        - build user commands, no libraries or include files
 # installmost - install user commands, no libraries or include files
 #
@@ -54,10 +53,6 @@ SUBDIR+= games
 .if exists(${.CURDIR}/gnu)
 SUBDIR+= gnu
 .endif
-.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
-    !defined(NO_CRYPT) && !defined(NO_OPENSSL) && defined(WANT_KERBEROS)
-SUBDIR+= kerberos5
-.endif
 .if exists(${.CURDIR}/libexec)
 SUBDIR+= libexec
 .endif
@@ -80,7 +75,6 @@ SUBDIR+= usr.bin
 SUBDIR+= usr.sbin
 .endif
 
-# etc must be last for "distribute" to work
 .if exists(${.CURDIR}/etc)
 SUBDIR+= etc
 .endif
@@ -105,12 +99,6 @@ CLEANDIR=   clean cleandepend
 CLEANDIR=      cleandir
 .endif
 
-SUP?=          /usr/local/bin/cvsup
-SUPFLAGS?=     -g -L 2 -P -
-.if defined(SUPHOST)
-SUPFLAGS+=     -h ${SUPHOST}
-.endif
-
 .if defined(NO_CLEAN)
 NOCLEAN=       # defined
 .endif
@@ -131,6 +119,16 @@ DESTDIRBASE?=              ${OBJTREE}${.CURDIR}
 # anyhow, and we need to be able to override it for stage installs
 .MAKEFLAGS:=   ${.MAKEFLAGS:NDESTDIR=*}
 
+# This sets the compiler we use to build the world/kernel with
+WORLD_CCVER?=  gcc41
+WORLD_BINUTILSVER?=    binutils217
+
+# temporary until everybody has converted to x86_64
+.if ${MACHINE_ARCH} == "amd64"
+MACHINE_ARCH=  x86_64
+.makeenv MACHINE_ARCH
+.endif
+
 TARGET_ARCH?=  ${MACHINE_ARCH}
 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
 TARGET?=       ${MACHINE}
@@ -139,6 +137,12 @@ TARGET?=   ${TARGET_ARCH}
 .endif
 .if make(buildworld)
 BUILD_ARCH!=   sysctl -n hw.machine_arch
+
+# temporary until everybody has converted to x86_64
+.if ${BUILD_ARCH} == "amd64"
+BUILD_ARCH=    x86_64
+.endif
+
 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
 .error To cross-build, set TARGET_ARCH.
 .endif
@@ -155,7 +159,7 @@ MACHINE_PLATFORM= pc32
 .if !defined(TARGET_PLATFORM)
 .if ${TARGET_ARCH} == "i386"
 TARGET_PLATFORM= pc32
-.elif ${TARGET_ARCH} == "amd64"
+.elif ${TARGET_ARCH} == "x86_64"
 TARGET_PLATFORM= pc64
 .else
 .error Unknown target architecture.
@@ -281,7 +285,10 @@ CROSSENV=  MAKEOBJDIRPREFIX=${WORLDDEST} \
                MACHINE_ARCH=${TARGET_ARCH} \
                MACHINE=${TARGET} \
                MACHINE_PLATFORM=${TARGET_PLATFORM} \
-               OBJFORMAT_PATH=${CTOOLSDEST}
+               OBJFORMAT_PATH=${CTOOLSDEST} \
+               HOST_CCVER=${HOST_CCVER} \
+               CCVER=${WORLD_CCVER} \
+               BINUTILSVER=${WORLD_BINUTILSVER}
 
 WMAKEENV=      ${CROSSENV} \
                DESTDIR=${WORLDDEST} \
@@ -305,7 +312,10 @@ KMAKEENV=  ${WMAKEENV}
 # Attempt to rebuild the entire system, with reasonable chance of
 # success, regardless of how old your existing system is.
 #
-_worldtmp:
+_worldtmp: _cleantmp _mtreetmp
+.ORDER: _cleantmp _mtreetmp
+
+_cleantmp:
        @echo
        @echo "--------------------------------------------------------------"
        @echo ">>> Rebuilding the temporary build tree"
@@ -317,6 +327,8 @@ _worldtmp:
        rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
        rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
 .endif
+
+_mtreetmp:
        mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
 .for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist        \
@@ -405,13 +417,15 @@ WMAKE_TGTS+=      _includes _libraries _depend everything
 
 buildworld: ${WMAKE_TGTS}
 
-quickworld: _obj _includes _libraries _depend everything
+quickworld: _mtreetmp _obj _includes _libraries _depend everything
 
-realquickworld: _obj _includes _libraries everything
+realquickworld: _mtreetmp _obj _includes _libraries everything
 
 crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
 
 .ORDER: ${WMAKE_TGTS}
+.ORDER: _obj _includes
+.ORDER: _mtreetmp _obj
 
 #
 # installcheck
@@ -429,17 +443,14 @@ installcheck:
 .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
        @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; exit 1;; esac
 .endif
-# distributeworld
-#
-# Distributes everything compiled by a `buildworld'.
 #
 # installworld
 #
 # Installs everything compiled by a 'buildworld'.
 #
-distributeworld installworld: installcheck
+installworld: installcheck
        cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
-       install -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc ${DESTDIR}/etc/upgrade/
+       ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc ${DESTDIR}/etc/upgrade/
 
 #
 # reinstall
@@ -466,12 +477,6 @@ reinstall:
        cd ${.CURDIR}/share/man; ${MAKE} makedb
 .endif
 
-redistribute:
-       @echo "--------------------------------------------------------------"
-       @echo ">>> Distributing everything.."
-       @echo "--------------------------------------------------------------"
-       cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
-
 #
 # buildkernel, nativekernel, quickkernel, and installkernel
 #
@@ -496,7 +501,13 @@ redistribute:
 KERNCONF=      ${KERNEL}
 KERNWARN=      yes
 .else
+# XXX makeshift fix to build the right kernel for the (target) architecture
+# We should configure this in the platform files somehow
+.if ${TARGET_ARCH} == "i386"
 KERNCONF?=     GENERIC
+.else
+KERNCONF?=     X86_64_GENERIC
+.endif
 .endif
 INSTKERNNAME?= kernel
 
@@ -592,9 +603,6 @@ buildkernel:        bk_tools bk_build_list bk_kernwarn
        echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
 .endif
        touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
-       cd ${KRNLOBJDIR}/${_kernel}; \
-           MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
-           ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
 .if !defined(NO_KERNELDEPEND)
        cd ${KRNLOBJDIR}/${_kernel}; \
            ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
@@ -689,46 +697,17 @@ quickkernel:      maybe_bk_tools bk_build_list bk_kernwarn
 # Install the kernel defined by INSTALLKERNEL
 #
 installkernel reinstallkernel:
-.if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
+       @echo "--------------------------------------------------------------"
+       @echo ">>> Kernel install for ${INSTALLKERNEL} started on `LC_ALL=C date`"
+       @echo "--------------------------------------------------------------"
+.if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
        cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
-           ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
+           ${IMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
 .else
        cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
            ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
 .endif
 
-#
-# update
-#
-# Update the source tree, by running sup and/or running cvs to update to the
-# latest copy.
-#
-update:
-.if defined(SUP_UPDATE)
-       @echo "--------------------------------------------------------------"
-       @echo ">>> Running ${SUP}"
-       @echo "--------------------------------------------------------------"
-.if defined(SUPFILE)
-       @${SUP} ${SUPFLAGS} ${SUPFILE}
-.endif
-.if defined(SUPFILE1)
-       @${SUP} ${SUPFLAGS} ${SUPFILE1}
-.endif
-.if defined(SUPFILE2)
-       @${SUP} ${SUPFLAGS} ${SUPFILE2}
-.endif
-.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
-       @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
-.endif
-.endif
-.if defined(CVS_UPDATE)
-       @echo "--------------------------------------------------------------"
-       @echo ">>> Updating ${.CURDIR} from cvs repository `cat ${.CURDIR}/CVS/Root`"
-       @echo "--------------------------------------------------------------"
-       @sleep 2
-       cd ${.CURDIR}; cvs -q update -P -d
-.endif
-
 #
 # most
 #
@@ -801,7 +780,7 @@ bootstrap-tools:
     usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
     usr.bin/tail \
     usr.sbin/chown usr.sbin/mtree usr.sbin/config \
-    usr.sbin/btxld usr.sbin/pwd_mkdb usr.sbin/zic usr.sbin/makewhatis \
+    usr.sbin/btxld usr.sbin/zic usr.sbin/makewhatis \
     gnu/usr.bin/texinfo gnu/usr.bin/grep gnu/usr.bin/sort \
     usr.bin/gzip usr.bin/bzip2 usr.bin/mkcsmapper usr.bin/mkesdb
        ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
@@ -822,22 +801,17 @@ bootstrap-tools:
 _share=        share/syscons/scrnmaps
 .endif
 
-.if !defined(NO_GCC34)
-_gcc34_cross= gnu/usr.bin/cc34
-_gcc34_tools= gnu/usr.bin/cc34/cc_prep gnu/usr.bin/cc34/cc_tools
-.endif
 _gcc41_cross= gnu/usr.bin/cc41
 _gcc41_tools= gnu/usr.bin/cc41/cc_prep gnu/usr.bin/cc41/cc_tools
-_binutils= gnu/usr.bin/binutils217
-
-.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
-    !defined(NO_CRYPT) && defined(WANT_KERBEROS)
-_libkrb5= kerberos5/tools kerberos5/lib/libroken kerberos5/lib/libvers \
-    kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
+.if !defined(NO_GCC44)
+_gcc44_cross= gnu/usr.bin/cc44
+_gcc44_tools= gnu/usr.bin/cc44/cc_prep gnu/usr.bin/cc44/cc_tools
 .endif
+_custom_cross= libexec/customcc
+_binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
 
 build-tools:
-.for _tool in ${_gcc34_tools} ${_gcc41_tools} ${_libkrb5} ${_share}
+.for _tool in ${_gcc41_tools} ${_gcc44_tools} ${_libkrb5} ${_share}
        ${ECHODIR} "===> ${_tool} (build-tools)"; \
                cd ${.CURDIR}/${_tool}; \
                ${MAKE} DIRPRFX=${_tool}/ obj; \
@@ -856,8 +830,8 @@ _btxld=     usr.sbin/btxld
 
 cross-tools:
 .for _tool in ${_btxld} ${_binutils} \
-             usr.bin/objformat usr.sbin/crunch/crunchide \
-             ${_gcc34_cross} ${_gcc41_cross}
+             usr.bin/objformat \
+             ${_gcc41_cross} ${_gcc44_cross} ${_custom_cross}
        ${ECHODIR} "===> ${_tool} (cross-tools)"; \
                cd ${.CURDIR}/${_tool}; \
                ${MAKE} DIRPRFX=${_tool}/ obj; \
@@ -884,14 +858,14 @@ hierarchy:
 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
 #
 libraries:
-.if !defined(NO_GCC34)
-       cd ${.CURDIR}; \
-           HOST_CCVER=${HOST_CCVER} CCVER=gcc34 \
-               ${MAKE} -f Makefile.inc1 _startup_libs34;
-.endif
        cd ${.CURDIR}; \
            HOST_CCVER=${HOST_CCVER} CCVER=gcc41 \
                ${MAKE} -f Makefile.inc1 _startup_libs41;
+.if !defined(NO_GCC44)
+       cd ${.CURDIR}; \
+           HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \
+               ${MAKE} -f Makefile.inc1 _startup_libs44;
+.endif
        cd ${.CURDIR}; \
            ${MAKE} -f Makefile.inc1 _startup_libs; \
            ${MAKE} -f Makefile.inc1 _prebuild_libs; \
@@ -901,34 +875,24 @@ libraries:
 # These dependencies are not automatically generated:
 #
 # gnu/lib/${CCVER}/libgcc and gnu/lib/${CCVER}/csu must be built before all
-# shared libraries for ELF.  The target for _startup_libs34 is
-# specifically built using gcc34.  Same goes for _startup_libs41.
+# shared libraries for ELF.  The target for _startup_libsXX is
+# specifically built using gccXX.
 #
-_startup_libs34=       gnu/lib/gcc34/csu gnu/lib/gcc34/libgcc
 _startup_libs41=       gnu/lib/gcc41/csu gnu/lib/gcc41/libgcc
-_startup_libs=         lib/libc lib/libc_rtld
+_startup_libs44=       gnu/lib/gcc44/csu gnu/lib/gcc44/libgcc
+_startup_libs=         lib/csu lib/libc lib/libc_rtld
 
-_prebuild_libs=                lib/libbz2 lib/libz lib/libarchive
+_prebuild_libs=                lib/libbz2 lib/libz
 _prebuild_libs+=       lib/libutil
 
 _generic_libs= gnu/lib
 
-.if !defined(NO_CRYPT) && defined(WANT_KERBEROS)
-_prebuild_libs+=       kerberos5/tools
-_prebuild_libs+=       kerberos5/lib/libasn1
-_prebuild_libs+=       kerberos5/lib/libgssapi
-_prebuild_libs+=       kerberos5/lib/libkrb5
-_prebuild_libs+=       kerberos5/lib/libroken
-_generic_libs+=        kerberos5/lib
-.endif
-
 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
                lib/libncurses/libncurses lib/libopie lib/libradius \
-               lib/libsbuf lib/libskey lib/libtacplus lib/libm \
-               lib/libpam lib/lib${THREAD_LIB}
+               lib/libsbuf lib/libtacplus lib/libm \
+               lib/libpam lib/libypclnt lib/lib${THREAD_LIB}
 
 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
-lib/libskey__L: lib/libcrypt__L lib/libmd__L
 
 _generic_libs+=        lib
 
@@ -945,7 +909,7 @@ _generic_libs+=     secure/lib
 
 _generic_libs+=        usr.bin/lex/lib
 
-.for _lib in ${_startup_libs34} ${_startup_libs41} \
+.for _lib in ${_startup_libs41} ${_startup_libs44} \
                ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
 ${_lib}__L: .PHONY
 .if exists(${.CURDIR}/${_lib})
@@ -958,16 +922,16 @@ ${_lib}__L: .PHONY
 .endfor
 
 _startup_libs: ${_startup_libs:S/$/__L/}
-_startup_libs34: ${_startup_libs34:S/$/__L/}
 _startup_libs41: ${_startup_libs41:S/$/__L/}
+_startup_libs44: ${_startup_libs44:S/$/__L/}
 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
 _generic_libs: ${_generic_libs:S/$/__L/}
 
 # library targets must be ordered because there are inter-library
 # races (e.g. generation of tconfig.h)
 #
-.ORDER: ${_startup_libs34:S/$/__L/}
 .ORDER: ${_startup_libs41:S/$/__L/}
+.ORDER: ${_startup_libs44:S/$/__L/}
 .ORDER: ${_startup_libs:S/$/__L/}
 .ORDER: ${_prebuild_libs:S/$/__L/}
 .ORDER: ${_generic_libs:S/$/__L/}
@@ -1012,5 +976,11 @@ tmake:
 tmakeenv:
        @echo '${TMAKEENV} /bin/sh'
 
+xmake:
+       @echo '${XMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${XMAKE_ARGS}'
+
+xmakeenv:
+       @echo '${XMAKEENV} /bin/sh'
+
 .include <bsd.subdir.mk>