/**/#	/usr/src/sys/Makefile_sub.c		V2.0	<jhs@

/**/#	Do not edit Makefile_sub, (produced from Makefile_sub.c by Makefile).

/**/#	Copyright: Julian Stacey, Munich, October 1993,
/**/#	Free Software - No Liability Accepted - See conditions in Makefile.

/**/#	This Makefile_sub.c is not known as Makefile.c for 2 reasons:
/**/#		recursive make depend might zap Makefile
/**/#		general cleaning shells might also zap Makefile

/**/.if exists (compile) & exists(compile/CONFIG_NAME)
/**/# exists is to stop cd failing & make going recursive
SUBDIR += compile/CONFIG_NAME	# CONFIG_NAME gets changed by cpp
/**/.endif

/**/# Next label recreates a compile tree if:
/**/#	- The config description file changes,
/**/#		for example if /sys/compile/GENERIC/Makefile is older than
/**/#		/sys/i386/conf/GENERIC, /sys/compile/GENERIC/* is rebuilt.
/**/#	- Changes occur to i386/conf/Makefile.i386 devices.i386 files.i386.
/**/#	- A new source tree is imported.  This might not be strictly necessary,
/**/#	  If the Makefile know of Every dependency, but as the kernel
/**/#	  evolves rapidly, it seems a harmless safety net.
/**/# 	- Changes occur to Makefile or Makefile_sub.c
CONFIG_TREE_TEST: CURDIR/${MACHINE}/conf/CONFIG_NAME	\
	CURDIR/${MACHINE}/conf/Makefile.${MACHINE} \
	CURDIR/${MACHINE}/conf/devices.${MACHINE} \
	CURDIR/${MACHINE}/conf/files.${MACHINE} \
	CURDIR/Makefile \
	C_SUB	
	@# C_SUB line above gets changed by cpp
	pwd
	@#echo -n Configuring a kernel compilation tree for CONFIG_NAME
	@#echo -n " as defined in "
	@#echo ${MACHINE}/conf/CONFIG_NAME.
	@#
	cd CURDIR/${MACHINE}/conf && config -n CONFIG_NAME
	@# -n added to config because make install calls config, & config
	@# otherwise does rm -rf compile/${CONGIG}
	@cd CURDIR/compile/CONFIG_NAME ; \
		if ! test -h @ ;  then \
			ln -s CURDIR @ ; \
		fi	# sym link to src tree
	cd CURDIR/compile/CONFIG_NAME && make depend
	@# For FreeBSD-1.1.5:	 make LOAD_ADDRESS=${LOAD_ADDRESS} depend

/**/# I don't need this label currently, but it's easy to provide.
/**/#	(depend is normally done straight after config)
depend:
	cd CURDIR/compile/CONFIG_NAME ; \
	if ! test -h @ ;  then \
		ln -s CURDIR @ ; \
	fi	# sym link to src tree
	cd CURDIR/compile/CONFIG_NAME && make depend

.include <bsd.subdir.mk>  # Does the subdir stuff in compile/_config_name_

/**/#	End of Makefile_sub.c

