# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc.  Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#

# END COPYRIGHT BLOCK
# --------------------------------------------------------------------------
#
#   Name: mcc package Makefile
#   Platform: gmake
#   ......................................................................
#   Notes:
#   * SRC_ defs are UNIX style relative directories
#   * To add a new .Z file to the distribution:
#     1) add it to the all: rule
#     2) create a SRC_ definition for it
#     3) cp other files into it
#     4) copy it to $(MCC_DIR)
#
#
# --------------------------------------------------------------------------
BUILD_ROOT=../..
MODULE=SETUP_MCC
NSROOT=$(BUILD_ROOT)

include $(NSROOT)/components.mk
include $(NSROOT)/nsconfig.mk

OBJDEST=$(OBJDIR)/mcc
ROOTBINDIR=$(NSROOT)/built/package/$(NSOBJDIR_NAME)/bin
LAYOUTDIR=$(OBJDEST)/layout
MCCLAYOUTDIR=$(LAYOUTDIR)/winmccz
MCC_DIR=$(NSROOT)/built/$(SECURITY)/mcc/dist/WINDOWS

#------------------------------------------------------------------
# Define the Directory layout structure for each zip file
#-----------------------------------------------------------------

all:  $(LAYOUTDIR) do-client 

do-client: $(MCC_DIR)/winmcc.zip

cleanit:
	-rm -f $(MCC_DIR)/winmcc.zip

#--------------------------------------------------------------------------
# SRC_ definitions are pointers to built modules
#--------------------------------------------------------------------------

$(LAYOUTDIR):
	-mkdir -p $(LAYOUTDIR)

$(MCC_DIR)/winmcc.zip:
	-rm -rf $(MCCLAYOUTDIR)
	mkdir -p $(MCC_DIR)
	mkdir -p $(MCCLAYOUTDIR)
	mkdir -p $(MCCLAYOUTDIR)/base
	mkdir -p $(MCCLAYOUTDIR)/svrcore
	cp $(ROOTBINDIR)/setup/*.* $(MCCLAYOUTDIR)
	cp $(ROOTBINDIR)/setup/svrcore/*.* $(MCCLAYOUTDIR)/svrcore
	cp $(ROOTBINDIR)/setup/base/client.z $(MCCLAYOUTDIR)/base
	cp $(ROOTBINDIR)/setup/base/jre.z $(MCCLAYOUTDIR)/base
	$(PERL) fixPI.pl SETUP_MCC $(BUILD_ROOT)/include/version.h $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat $(BUILD_SECURITY) base.inf $(MCCLAYOUTDIR)/base/base.inf
	cd $(MCCLAYOUTDIR) ; $(ZIP) -r winmcc.zip *
	cp $(MCCLAYOUTDIR)/winmcc.zip $(MCC_DIR)

makefiles:
depend:
