# 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$(DESTDIR)\include\afs

# 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

MANIFEST = $(EXEFILE).manifest

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 \
        $(OUT)\cm_nls.obj

AFSD= ..\afsd

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

EXELIBS = \
	$(DESTDIR)\lib\afs\TaAfsAppLib.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 \
        $(DESTDIR)\lib\afs\afsutil.lib \
	$(DESTDIR)\lib\opr.lib \
	$(DESTDIR)\lib\afsroken.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

AFSAPPLIB=..\afsapplib

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

$(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) $(AFSDOBJS) $(EXELIBS)
	$(EXEGUILINK) $(VCLIBS)
!IF ("$(AFSVER_CL)" == "1400")
        if exist $@.manifest mt.exe -manifest afs_config.exe.manifest $@.manifest -out:$(MANIFEST)
!ELSE
        $(COPY) afs_config.exe.manifest $(MANIFEST)
!ENDIF
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

install : $(COPYHEADERS) $(EXEFILE) lang

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)
        $(DEL) $(MANIFEST)
	$(CD) lang
	$(DEL) AFS_component_version_number.h
	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 ..
