# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

# include the AFSD source tree on our inclusion path

AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd

# include the primary makefile
RELDIR=WINNT\client_config
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!include ..\..\config\NTMakefile.version

############################################################################
#
# BUILD TARGETS
#

EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_config.exe

EXEOBJS = \
	$(OUT)\config.obj \
	$(OUT)\drivemap.obj \
	$(OUT)\main.obj \
	$(OUT)\misc.obj \
	$(OUT)\pagesize.obj \
	$(OUT)\tab_advanced.obj \
	$(OUT)\tab_drives.obj \
	$(OUT)\tab_hosts.obj \
	$(OUT)\tab_general.obj \
	$(OUT)\tab_prefs.obj \
	$(OUT)\dlg_logon.obj \
	$(OUT)\dlg_diag.obj \
	$(OUT)\dlg_misc.obj \
	$(OUT)\isadmin.obj \
	$(OUT)\dlg_automap.obj \
    $(OUT)\dlg_binding.obj \
    $(OUT)\RegistrySupport.obj

EXEOBJSc = \
	$(OUT)\cellservdb.obj

EXERES = \
	$(OUT)\afs_config_stub.res 

AFSDOBJS = \
	$(OUT)\fs_utils.obj
	
AFSD= ..\afsd

VCLIBS =\
	comctl32.lib \
	shell32.lib \
	mpr.lib \
    netapi32.lib

EXELIBS = \
	$(DESTDIR)\lib\afs\TaLocale.lib \
	$(DESTDIR)\lib\afsrpc.lib \
	$(DESTDIR)\lib\afsauthent.lib \
	$(DESTDIR)\lib\libosi.lib \
	$(DESTDIR)\lib\libafsconf.lib \
    $(DESTDIR)\lib\lanahelper.lib \
    $(DESTDIR)\lib\afs\afsreg.lib

############################################################################
#
# EXTERNAL SOURCE FILES
#
# The following source files are required by this application, but live
# elsewhere in the tree. To prevent checking in more than one copy of the
# source files, they are copied to this directory at build-time.
#

COPYHEADERS = \
	$(DESTDIR)\include\WINNT\al_resource.h \
	$(DESTDIR)\include\WINNT\checklist.h \
	$(DESTDIR)\include\WINNT\ctl_sockaddr.h \
	$(DESTDIR)\include\WINNT\ctl_spinner.h \
	$(DESTDIR)\include\WINNT\dialog.h \
	$(DESTDIR)\include\WINNT\fastlist.h \
	$(DESTDIR)\include\WINNT\hashlist.h \
	$(DESTDIR)\include\WINNT\resize.h \
	$(DESTDIR)\include\WINNT\subclass.h

AFSAPPLIBOBJS= \
	$(OUT)\hashlist.obj \
	$(OUT)\resize.obj \
	$(OUT)\subclass.obj \
	$(OUT)\fastlist.obj \
	$(OUT)\dialog.obj \
	$(OUT)\ctl_sockaddr.obj \
	$(OUT)\ctl_spinner.obj \
	$(OUT)\checklist.obj

AFSAPPLIB=..\afsapplib

$(AFSAPPLIBOBJS): $(AFSAPPLIB)\$$(@B).cpp
	$(C2OBJ) -I$(AFSAPPLIB) $**

$(AFSDOBJS): $(AFSD)\$$(@B).c
	$(C2OBJ) -I$(AFSD) $**

$(EXEOBJS): $$(@B).cpp
	$(C2OBJ) -I$(AFSAPPLIB) $**

$(EXEOBJSc): $$(@B).c
	$(CPP2OBJ) -I$(AFSAPPLIB) $**

############################################################################

{..\afsapplib}.h{$(DESTDIR)\include\WINNT}.h:
	$(COPY) ..\afsapplib\$(*B).h $(DESTDIR)\include\WINNT


############################################################################

$(EXEFILE) : $(EXEOBJS) $(EXEOBJSc) $(EXERES) $(AFSAPPLIBOBJS) $(AFSDOBJS) $(EXELIBS)
	$(EXEGUILINK) $(VCLIBS)
	$(EXEPREP) 

install : $(COPYHEADERS) $(EXEFILE) lang

install9x: install

lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE


############################################################################
#
# Dependencies
#

en_US:
	$(CD) lang
	$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

ja_JP:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

ko_KR:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

zh_CN:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

zh_TW:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

pt_BR:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

es_ES:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

de_DE:
	$(CD) lang
	@$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
    $(CD) ..

$(OUT)\afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h

clean::
	$(DEL) $(COPYHEADERS)
	$(CD) lang
	if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /e /f NTMakefile clean
	if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /e /f NTMakefile clean
    $(CD) ..

mkdir:
	-mkdir $(OUT)\lang
	cd lang
	nmake /nologo /e /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
	cd ..
