#
# @(#)Makefile	1.36 98/08/28
#
# Top level makefile for Win32
#

#
# Most frequently used targets:
#
#    all         -- build optimized and debug versions of the core JDK.
#    ext         -- build optimized and debug versions of extensions.
#    world       -- build both "all" and "ext" targets.
#    releasedocs -- run javadoc to generate the JDK documentation.
#    alldocs     -- run javadoc on everything including sun.*
#
#  There are also some release engineering targets. See
#  ./makefiles/release.nmk for their descriptions.
#
#  "all" should perhaps mean "world". But in the past, "all" has
#  meant opt+dbg of core, so we retain that interpretation for
#  historical reasons.
#

BUILDDIR=.
!include $(BUILDDIR)/makefiles/defs.nmk

#
# Core.
#
SUBDIRS = java javax sun sunw corba com mkdemo
default: $(SUBDIRS)
$(SUBDIRS): sanity
	@echo +++Recursively making $(ACTION) $@ ...
	@cd $@
	$(MAKE) -nologo $(ACTION) RELEASE="$(RELEASE)" FULL_VERSION="$(FULL_VERSION)"
	@cd ..
	@echo ---Finished Recursively making $(ACTION) $@.
all optimized debug clean clobber:
	$(MAKE) -nologo ACTION=$@ RELEASE="$(RELEASE)" FULL_VERSION="$(FULL_VERSION)"

#
# Extensions.
#
ext-all: i18n-all iiimp-all
ext-optimized: i18n-optimized iiimp-optimized
ext-debug: i18n-debug iiimp-debug
ext-clean: i18n-clean iiimp-clean
ext-clobber: i18n-clobber iiimp-clobber
# nmake lacks a loop construct -- so hide details.
!include $(BUILDDIR)\makefiles\ext.nmk

#
# Everything.
#
world-all: all ext-all
world-optimized: optimized ext-optimized
world-debug: debug ext-debug
world-clean: clean ext-clean
world-clobber: clobber ext-clobber

#
# Convenient aliases.
#
ext: ext-all
world: world-all

#
# Build a Swing distribution for JDK1.1.x.
#
swing-1.1 swing-1.1-clobber: FORCE
	cd sun
	$(MAKE) -nologo RELEASE="$(RELEASE)" FULL_VERSION="$(FULL_VERSION)" $@
	cd ..

#
# Documentation targets "releasedocs" and "alldocs"
#
releasedocs alldocs: FORCE
	@echo Not implemented. Use Solaris build tree for now.

#
# Release engineering.
#
!include $(BUILDDIR)\makefiles\release.nmk

#
# Sanity checks.  To override, set the environment variable INSANE to 'yes'.
#
sanity: FORCE
	@sh $(BUILDDIR)/../share/tools/sanityck

#
# We don't want this to come from rules.nmk or that would cause a
# bogus clean after a clobber.
#
FORCE: ;
