!INCLUDE $(NTMAKEENV)\makefile.plt
#
# If BUILDMSG is not defined, the define it as the empty string to make
# the conditionals easier to write.
#

!IFNDEF BUILDMSG
BUILDMSG=
!ENDIF

!IFNDEF NO_STRICT
STRICT=1
!ENDIF

!ifndef DXGROOT
DXGROOT = $(DXROOT)\dxg
!endif

!ifndef D3DROOT
D3DROOT = $(DXGROOT)\d3d
!endif

DXGGEN = $(PROJECT_ROOT)\published\dxg

D3DDX7INC = $(D3DROOT)\dx7\inc

TARGETSRCS0 = \
        d3dmkhdr.m4              \
        $(D3DDX7INC)\d3dp.h      \
        $(D3DDX7INC)\d3dtypesp.h \
        $(D3DDX7INC)\d3dcapsp.h  \
        $(D3DDX7INC)\d3dhal.h 



TARGETSRCS = $(TARGETSRCS0)

all: $(TARGETSRCS)
!IF "$(BUILDMSG)" != ""
    @ech ; $(BUILDMSG) ;
!ENDIF

clean: all

clean1: cleansrc all

cleansrc:
# Use for loop because command.com's erase doesn't support multiple
# file listings.  Separate sources into smaller lists because command.com
# faults.  Totally bogus.
    -@for %x in ($(TARGETSRCS0)) do erase %x
    -@for %x in ($(TARGETSRCS1)) do erase %x

HSPLITFLAGS = -ts dx3 -ts dx4 -ts dx5 -ts dx6 -ta dx7 -ts dx8 -v 700 -ts external -ta internal

d3dmkhdr.m4 : $(DXGGEN)\d3dmkhdr.m4
        copy $(DXGGEN)\d3dmkhdr.m4 .

$(D3DDX7INC)\d3dtypesp.h: $(DXGGEN)\d3dtypes.w $(DXGGEN)\d3dmkhdr.m4
	m4 $(DXGGEN)\d3dtypes.w > tmp.wx
	hsplit $(HSPLITFLAGS) -o $@ tmp.px tmp.wx
	del tmp.wx
	del tmp.px

$(D3DDX7INC)\d3dp.h: $(DXGGEN)\d3d.w $(DXGGEN)\d3dmkhdr.m4
	m4 $(DXGGEN)\d3d.w > tmp.wx
	hsplit $(HSPLITFLAGS) -o $@ tmp.px tmp.wx
	del tmp.wx
	del tmp.px

$(D3DDX7INC)\d3dcapsp.h: $(DXGGEN)\d3dcaps.w $(DXGGEN)\d3dmkhdr.m4
	m4 $(DXGGEN)\d3dcaps.w > tmp.wx
	hsplit $(HSPLITFLAGS) -o $@ tmp.px tmp.wx
	del tmp.wx
	del tmp.px

$(D3DDX7INC)\d3dhal.h: $(DXGGEN)\d3dhal.w $(DXGGEN)\d3dmkhdr.m4
	m4 $(DXGGEN)\d3dhal.w > tmp.wx
	hsplit $(HSPLITFLAGS) -o $@ tmp.px tmp.wx
	del tmp.wx
	del tmp.px