Module Name: src
Committed By: apb
Date: Sun Dec 2 12:34:51 UTC 2012
Modified Files:
src/tools/compat: Makefile
Log Message:
Make tools/compat/Makefile install the library in
${TOOLDIR}/lib/libnbcompat.a, install the include files in
${TOOLDIR}/include/compat/**, and install defs.mk in
${TOOLDIR}/share/compat/defs.mk. Previously, nothing from
tools/compat was installed under TOOLDIR.
Adjust tools/compat/Makefile to use an uninstalled copy of
host-mkdep from the .OBJDIR of tools/host-mkdep, and an uninstalled
copy of the install program from the .OBJDIR of tools/binstall.
This allows it to be built after tools/host-mkdep is built but
before tools/host-mkdep is installed; and to be installed after
tools/binstall is built but before tools/binstall is installed.
To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/tools/compat/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tools/compat/Makefile
diff -u src/tools/compat/Makefile:1.60 src/tools/compat/Makefile:1.61
--- src/tools/compat/Makefile:1.60 Sun Dec 2 12:19:34 2012
+++ src/tools/compat/Makefile Sun Dec 2 12:34:51 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.60 2012/12/02 12:19:34 apb Exp $
+# $NetBSD: Makefile,v 1.61 2012/12/02 12:34:51 apb Exp $
HOSTLIB= nbcompat
@@ -55,6 +55,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR}
DPSRCS+= defs.mk
CLEANFILES+= config.log config.status configure.lineno *.stamp
+CLEANDIRFILES+= defs.mk config.cache confdefs.h
# Get components of Berkeley DB.
_CURDIR:= ${.CURDIR}
@@ -72,14 +73,55 @@ config.cache: include/.stamp configure n
defs.mk: config.cache
@touch ${.TARGET}
+INCFILES= nbtool_config.h
+INCSUBDIRS= sys machine rpc arpa
+CLEANDIRFILES+= ${INCFILES}
+
+# CLEANDIRFILES may not contain directory names
+cleandir: cleandir.include
+cleandir.include: .PHONY
+ rm -rf include
+
include/.stamp:
- mkdir -p include/sys include/machine include/rpc include/arpa
+ mkdir -p ${INCSUBDIRS:@d@ include/$d @}
@touch ${.TARGET}
-cleandir:
- -rm -f nbtool_config.h confdefs.h defs.mk
- -rm -r -f include
- -rm -f config.cache
+# Install rules
+
+HOST_LIBDIR= ${TOOLDIR}/lib
+HOST_INCSDIR= ${TOOLDIR}/include
+HOST_SHAREDIR= ${TOOLDIR}/share
+
+install: .PHONY install.lib install.includes install.defs.mk
+
+# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib
+install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a
+${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a
+ ${_MKTARGET_INSTALL}
+ ${HOST_INSTALL_DIR} ${HOST_LIBDIR}
+ ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+
+# Install include files in ${TOOLDIR}/include/compat
+install.includes: .PHONY
+ ${_MKMSG_INSTALL} "${HOST_INCSDIR}/*"
+ ${HOST_INSTALL_DIR} ${HOST_INCSDIR}
+ ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat
+ ${HOST_INSTALL_FILE} ${INCFILES} ${HOST_INCSDIR}/compat/
+.for _d in ${INCSUBDIRS}
+ ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat/${_d}
+ touch include/${_d}/dummy # ensure dir is not empty
+ ${HOST_INSTALL_FILE} include/${_d}/* ${HOST_INCSDIR}/compat/${_d}/
+.endfor
+
+# Install defs.mk in ${TOOLDIR}/share/compat
+install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
+${HOST_SHAREDIR}/compat/defs.mk: defs.mk
+ ${_MKTARGET_INSTALL}
+ ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}
+ ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat
+ ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
+
+# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS
HOST_CPPFLAGS:= ${CPPFLAGS}
CPPFLAGS:= # empty
@@ -91,6 +133,10 @@ HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-m
HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep
MKDEP= ${HOST_MKDEP}
+# Use uninstalled copy of the install program
+INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
+INSTALL= ${INSTALL_OBJ}/xinstall
+
# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
# configure.ac. See more detailed instructions in configure.ac.
regen: