summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc154
-rw-r--r--sys/conf/files29
-rw-r--r--sys/dev/aic7xxx/aicasm/Makefile8
-rw-r--r--sys/modules/aic7xxx/Makefile2
-rw-r--r--sys/modules/aic7xxx/ahc/Makefile7
-rw-r--r--sys/modules/aic7xxx/ahd/Makefile7
6 files changed, 57 insertions, 50 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index f8ebcc0..fed4bdb 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -264,6 +264,21 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-DWITHOUT_GDB -DNO_TESTS
+# kernel-tools stage
+KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
+ PATH=${BPATH}:${PATH} \
+ WORLDTMP=${WORLDTMP} \
+ VERSION="${VERSION}" \
+ COMPILER_TYPE=${COMPILER_TYPE}
+KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
+ ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
+ DESTDIR= \
+ BOOTSTRAPPING=${OSRELDATE} \
+ SSP_CFLAGS= \
+ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
+ -DNO_PIC -DNO_PROFILE -DNO_SHARED \
+ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+
# world stage
WMAKEENV= ${CROSSENV} \
_SHLIBDIRPREFIX=${WORLDTMP} \
@@ -543,6 +558,7 @@ _cross-tools:
@echo ">>> stage 3: cross tools"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
+ ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
_includes:
@echo
@echo "--------------------------------------------------------------"
@@ -1032,21 +1048,7 @@ buildkernel:
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools"
@echo "--------------------------------------------------------------"
- cd ${KRNLOBJDIR}/${_kernel}; \
- PATH=${BPATH}:${PATH} \
- MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
- ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
- -DEARLY_BUILD -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
-# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
-.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
-.for target in obj depend all
- cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
- PATH=${BPATH}:${PATH} \
- MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
- ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
- -DEARLY_BUILD ${target}
-.endfor
-.endif
+ ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
.if !defined(NO_KERNELDEPEND)
@echo
@echo "--------------------------------------------------------------"
@@ -1334,10 +1336,6 @@ bootstrap-tools: .MAKE
#
# build-tools: Build special purpose build tools
#
-.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
-_aicasm= sys/modules/aic7xxx/aicasm
-.endif
-
.if !defined(NO_SHARE)
_share= share/syscons/scrnmaps
.endif
@@ -1359,7 +1357,6 @@ build-tools: .MAKE
lib/ncurses/ncurses \
lib/ncurses/ncursesw \
${_share} \
- ${_aicasm} \
usr.bin/awk \
lib/libmagic \
usr.bin/mkesdb_static \
@@ -1380,6 +1377,23 @@ build-tools: .MAKE
.endfor
#
+# kernel-tools: Build kernel-building tools
+#
+kernel-tools: .MAKE
+ mkdir -p ${MAKEOBJDIRPREFIX}/usr
+ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
+ -p ${MAKEOBJDIRPREFIX}/usr >/dev/null
+.for _tool in \
+ sys/dev/aic7xxx/aicasm
+ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
+ cd ${.CURDIR}/${_tool} && \
+ ${MAKE} DIRPRFX=${_tool}/ obj && \
+ ${MAKE} DIRPRFX=${_tool}/ depend && \
+ ${MAKE} DIRPRFX=${_tool}/ all && \
+ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
+.endfor
+
+#
# cross-tools: Build cross-building tools
#
.if !defined(TARGET_ARCH) && defined(XDEV_ARCH)
diff --git a/sys/conf/files b/sys/conf/files
index ad2e11c..4cae600 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -9,44 +9,39 @@ acpi_quirks.h optional acpi \
compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \
no-obj no-implicit-rule before-depend \
clean "acpi_quirks.h"
-aicasm optional ahc | ahd \
- dependency "$S/dev/aic7xxx/aicasm/*.[chyl]" \
- compile-with "CC='${CC}' ${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \
- no-obj no-implicit-rule \
- clean "aicasm* y.tab.h"
aic7xxx_seq.h optional ahc \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
no-obj no-implicit-rule before-depend local \
clean "aic7xxx_seq.h" \
- dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic7xxx_reg.h optional ahc \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
no-obj no-implicit-rule before-depend local \
clean "aic7xxx_reg.h" \
- dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic7xxx_reg_print.c optional ahc \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \
no-obj no-implicit-rule local \
clean "aic7xxx_reg_print.c" \
- dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic7xxx_reg_print.o optional ahc ahc_reg_pretty_print \
compile-with "${NORMAL_C}" \
no-implicit-rule local
aic79xx_seq.h optional ahd pci \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
no-obj no-implicit-rule before-depend local \
clean "aic79xx_seq.h" \
- dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic79xx_reg.h optional ahd pci \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
no-obj no-implicit-rule before-depend local \
clean "aic79xx_reg.h" \
- dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic79xx_reg_print.c optional ahd pci \
- compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
+ compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \
no-obj no-implicit-rule local \
clean "aic79xx_reg_print.c" \
- dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h"
aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \
compile-with "${NORMAL_C}" \
no-implicit-rule local
diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile
index e160807..f31a774 100644
--- a/sys/dev/aic7xxx/aicasm/Makefile
+++ b/sys/dev/aic7xxx/aicasm/Makefile
@@ -15,7 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS}
CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g}
DPADD= ${LIBL}
LDADD= -ll
-WARNS?= 5
+WARNS?= 0
# Correct path for kernel builds
# Don't rely on the kernel's .depend file
@@ -24,7 +24,7 @@ WARNS?= 5
DEPENDFILE= .depend_aicasm
.endif
-CFLAGS+= -I.
+CFLAGS+= -I${.CURDIR}
.ifdef MAKESRCPATH
CFLAGS+= -I${MAKESRCPATH}
.endif
@@ -38,5 +38,9 @@ YFLAGS+= -t -v
LFLAGS+= -d
.endif
+BINDIR=/usr/bin
+
+build-tools: ${PROG}
+
.include <bsd.prog.mk>
CFLAGS+= -Wno-missing-prototypes
diff --git a/sys/modules/aic7xxx/Makefile b/sys/modules/aic7xxx/Makefile
index 47550f0..08567a6 100644
--- a/sys/modules/aic7xxx/Makefile
+++ b/sys/modules/aic7xxx/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SUBDIR= aicasm ahc ahd
+SUBDIR= ahc ahd
.include <bsd.subdir.mk>
diff --git a/sys/modules/aic7xxx/ahc/Makefile b/sys/modules/aic7xxx/ahc/Makefile
index 66780d8..b69fbaf 100644
--- a/sys/modules/aic7xxx/ahc/Makefile
+++ b/sys/modules/aic7xxx/ahc/Makefile
@@ -15,13 +15,10 @@ REG_PRINT_OPT= -p aic7xxx_reg_print.c
.endif
BEFORE_DEPEND = ${GENSRCS}
-../aicasm/aicasm: ${.CURDIR}/../../../dev/aci7xxx/aicasm/*.[chyl]
- ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; )
-
${GENSRCS}: \
${.CURDIR}/../../../dev/aic7xxx/aic7xxx.{reg,seq} \
- ${.CURDIR}/../../../cam/scsi/scsi_message.h ../aicasm/aicasm
- ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \
+ ${.CURDIR}/../../../cam/scsi/scsi_message.h
+ aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \
-I${.CURDIR}/../../../dev/aic7xxx \
-o aic7xxx_seq.h -r aic7xxx_reg.h \
${REG_PRINT_OPT} \
diff --git a/sys/modules/aic7xxx/ahd/Makefile b/sys/modules/aic7xxx/ahd/Makefile
index 77885c7..b1e7900 100644
--- a/sys/modules/aic7xxx/ahd/Makefile
+++ b/sys/modules/aic7xxx/ahd/Makefile
@@ -15,13 +15,10 @@ REG_PRINT_OPT= -p aic79xx_reg_print.c
.endif
BEFORE_DEPEND= ${GENSRCS}
-../aicasm/aicasm: ${.CURDIR}/../../../dev/aic7xxx/aicasm/*.[chyl]
- ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; )
-
${GENSRCS}: \
${.CURDIR}/../../../dev/aic7xxx/aic79xx.{reg,seq} \
- ${.CURDIR}/../../../cam/scsi/scsi_message.h ../aicasm/aicasm
- ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \
+ ${.CURDIR}/../../../cam/scsi/scsi_message.h
+ aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \
-I${.CURDIR}/../../../dev/aic7xxx \
-o aic79xx_seq.h -r aic79xx_reg.h \
${REG_PRINT_OPT} \
OpenPOWER on IntegriCloud