#
#	Layers subsystem makefile (generated from 12/26/90 template)
#

#	Remove '#' from next line for "silent" operation
#!CMDSWITCHES +s

#	Temporary files
T1	= $(TMP)\caz1.tmp
T2	= $(TMP)\caz2.tmp
T3	= $(TMP)\caz3.tmp

#	Path to WGA Tools Project
W	= $(WGA)

#	Path to Layers Project Directory
L	= $(LAYERS)

#	Path to directory holding make stuff
M	= $L\makestuf

#	Path to directory holding forms preprocessor
FPP	= $L\bin\formpp.exe

#	Path to Local project
Z	= $(BANDIT)

# 	Layrport
J	=$Z\src\layrport

#	Sibling-invariant name of this directory
H	= $Z\tools\mvcal

#	Location of resources directory
!IF "$(RESOURCE)" == ""
R	= $Z\src\usa
!ELSE
R	= $(RESOURCE)
!ENDIF


#	Location of the Layers Source Include directory
I	= $L\inc

#	Location of the Calendar Source Include directory
X	= $Z\inc

#	Location of the Demilayr directory
D	= $L\src\demilayr


#	Files on which every file of a given type depends.
#	Add others as appropriate, for instance, add $I\framewrk.hxx
#	if the Framework is used.
INCLS	= $J\slingsho.h $J\demilayr.h $H\mvcal.h $R\mvcal.sr $H\nonintl.sr
AINCLS	= $I\slingsho.inc $I\debug.inc
INCLSXX	= $I\slingsho.h $I\demilayr.h
INCLSDES= forms.map $(FPP)

#	Pseudo target files for .hxx and .frm files.  Generated from .des
DES_XXX	=

goal:	external


#	Ensure version is defined
!IF "$(VERSION)" == ""
VERSION	= WINDOWS
!ENDIF

#	Ensure DLL is defined (default value 0)
!IF "$(DLL)" == ""
DLL	= 0
!ENDIF

#	Ensure DLLXDEFS is not defined if not a DLL
!IF "$(DLL)" == "0"
!IF	"$(DLLXDEFS)" != ""
DLLXDEFS=
!ENDIF
!ENDIF

#	Compiler and assembler flags

!IF "$(VERSION)" == "WINDOWS"
DEFS	= -DDEBUG -DMINTEST -DSCHED_DIST_PROG -DDUMP_LOG
CFLAGS  = -c -AL -Od -Z7p -G2d -W3 -J -Gz -Zel -H64 -G4 -I. -I$Z\src\schdist -I$Z\src\layrport -I$R
AFLAGS	= -Mx -Z -Zi -L -t
!ENDIF
!IF "$(VERSION)" == "WINDOWS_SHIP"
DEFS	= -DMINTEST -DSCHED_DIST_PROG -DDUMP_LOG
CFLAGS  = -c -AL -Owx -Zp -G2sd -W3 -J -Gz -Zel -H64 -G4 -I. -I$Z\src\schdist -I$Z\src\layrport -I$R
AFLAGS	= -Mx -t
!ENDIF
!IF "$(VERSION)" == "WINDOWS_TEST"
DEFS	= -DMINTEST -DSCHED_DIST_PROG -DDUMP_LOG
CFLAGS  = -c -AL -Owx -Z7p -G2sd -W3 -J -Gz -Zel -H64 -G4 -I. -I$Z\src\schdist -I$Z\src\layrport -I$R
AFLAGS	= -Mx -Zi -t
!ENDIF


OBJS0	= codepage.obj mvcal.obj nlsload.obj passwd.obj 

!IF "$(DLL)" != "0"
OBJSDLL	= strings.obj
!ENDIF

#####

.SUFFIXES: .h .c .asm .obj .exe .cxx .res .rc .bas .des

{$H}.c.obj:
	echo +++++++++
	echo COMPILING $*.c
		cc $(CFLAGS) $(DEFS) $H\$*.c


{$H}.asm.obj:
	echo +++++++++
	echo ASSEMBLING $*.asm
		masm $(AFLAGS) $(DEFS) $H\$*.asm;


{$H}.cxx.obj:
	echo +++++++++
	echo COMPILING $*.cxx
		cc $(CFLAGS) $(DEFS) $H\$*.cxx


#	.frm and .hxx generated together; only one rule is/need be called
#
#	NOTE:  The .hxx and .frm files are byproducts of the following rule.

{$H}.des.xxx:
	echo +++++++++
	echo PROCESSING $*.des
		touch $*.xxx
		formpp -dialog -f $(TMP)\$*.frm -h $(TMP)\$*.hxx $H\$*
		onerr diff $(TMP)\$*.frm $*.frm ! cp $(TMP)\$*.frm $*.frm >nul
		onerr diff $(TMP)\$*.hxx $*.hxx ! cp $(TMP)\$*.hxx $*.hxx >nul
	    -rm $(TMP)\$*.frm $(TMP)\$*.hxx


##### Put subsystem-specific make rules here #####

strings.obj: $D\strings.c strings.h strings.sr $(INCLS)
	echo +++++++++
	echo COMPILING $*.c
		cc $(CFLAGS) $(DEFS) $D\$*.c



##### EXTERNAL #####

objs.ext: $H\makefile
	echo ++++++++++
	echo BUILDING $@
		-del objs.ext
		echo $(OBJS0)					>> objs.ext
!IF "$(DLL)" != "0"
		echo $(OBJSDLL)					>> objs.ext
!ENDIF


external: \
		$(DES_XXX) $(OBJS0) \
!IF "$(DLL)" != "0"
		$(OBJSDLL) \
!ENDIF

			echo +++ MADE EXTERNAL $(VERSION) test



##### Dependencies #####

#	WARNING!!! These dependencies are obviously not complete.  
#	They need to filled in by the developer.

codepage.obj: $H\codepage.c $(INCLS)
mvcal.obj: $H\mvcal.c $(INCLS)
nlsload.obj: $H\nlsload.c $(INCLS)
passwd.obj: $H\passwd.c $(INCLS)
