PRIVATE_IDL_H_SRCS = \
	wine/winedxgi.idl

PUBLIC_IDL_H_SRCS = \
	activaut.idl \
	activdbg.idl \
	activscp.idl \
	amstream.idl \
	amvideo.idl \
	asptlb.idl \
	atliface.idl \
	audioclient.idl \
	audiopolicy.idl \
	austream.idl \
	bits.idl \
	bits1_5.idl \
	comcat.idl \
	commoncontrols.idl \
	control.idl \
	cor.idl \
	cordebug.idl \
	ctfutb.idl \
	ctxtcall.idl \
	d3d10.idl \
	d3d10_1.idl \
	d3d11.idl \
	d3dcommon.idl \
	ddstream.idl \
	devicetopology.idl \
	dimm.idl \
	dispex.idl \
	docobj.idl \
	docobjectservice.idl \
	downloadmgr.idl \
	dwrite.idl \
	dwrite_1.idl \
	dxgi.idl \
	endpointvolume.idl \
	exdisp.idl \
	fusion.idl \
	gameux.idl \
	hlink.idl \
	htiface.idl \
	htiframe.idl \
	httprequest.idl \
	iads.idl \
	icftypes.idl \
	iextag.idl \
	imnact.idl \
	imnxport.idl \
	indexsrv.idl \
	mediaobj.idl \
	metahost.idl \
	mimeinfo.idl \
	mimeole.idl \
	mlang.idl \
	mmc.idl \
	mmdeviceapi.idl \
	mmstream.idl \
	mscoree.idl \
	msctf.idl \
	msdadc.idl \
	msdasc.idl \
	mshtmhst.idl \
	mshtml.idl \
	msident.idl \
	msinkaut.idl \
	mstask.idl \
	msxml.idl \
	msxml2.idl \
	msxml6.idl \
	netcon.idl \
	netfw.idl \
	oaidl.idl \
	objectarray.idl \
	objidl.idl \
	objsafe.idl \
	ocidl.idl \
	ocmm.idl \
	oleacc.idl \
	oledb.idl \
	oleidl.idl \
	optary.idl \
	perhist.idl \
	propidl.idl \
	propsys.idl \
	pstore.idl \
	qedit.idl \
	richole.idl \
	sensevts.idl \
	servprov.idl \
	shdeprecated.idl \
	shldisp.idl \
	shobjidl.idl \
	shtypes.idl \
	strmif.idl \
	structuredquerycondition.idl \
	textstor.idl \
	tlogstg.idl \
	tom.idl \
	transact.idl \
	txcoord.idl \
	txdtc.idl \
	uiautomationclient.idl \
	uiautomationcore.idl \
	unknwn.idl \
	urlhist.idl \
	urlmon.idl \
	vmr9.idl \
	wbemcli.idl \
	wbemprov.idl \
	wia_lh.idl \
	wia_xp.idl \
	wincodec.idl \
	wincodecsdk.idl \
	wine/itss.idl \
	wine/svcctl.idl \
	winsxs.idl \
	wmiutils.idl \
	wmsbuffer.idl \
	wmsdkidl.idl \
	wpcapi.idl \
	wtypes.idl \
	wuapi.idl \
	xmllite.idl

IDL_TLB_SRCS = \
	stdole2.idl

XTEMPLATE_SRCS = \
	rmxftmpl.x

SRCDIR_INCLUDES = \
	$(IDL_TLB_SRCS) \
	$(PUBLIC_IDL_H_SRCS) \
	$(XTEMPLATE_SRCS) \
	accctrl.h \
	access.idl \
	aclapi.h \
	aclui.h \
	adshlp.h \
	advpub.h \
	af_irda.h \
	amaudio.h \
	appcompatapi.h \
	appmgmt.h \
	asynot.idl \
	asysta.idl \
	atlbase.h \
	atlwin.h \
	audevcod.h \
	audiosessiontypes.h \
	aviriff.h \
	avrt.h \
	axcore.idl \
	axextend.idl \
	basetsd.h \
	basetyps.h \
	bcrypt.h \
	binres.idl \
	bitsmsg.h \
	cderr.h \
	cfgmgr32.h \
	cguid.h \
	cierror.h \
	clusapi.h \
	cmdbas.idl \
	cmdtxt.idl \
	commctrl.h \
	commctrl.rh \
	commdlg.h \
	compobj.h \
	corerror.h \
	corhdr.h \
	cpl.h \
	crtrow.idl \
	cryptdlg.h \
	cryptuiapi.h \
	custcntl.h \
	cvconst.h \
	d3d.h \
	d3d10_1shader.h \
	d3d10effect.h \
	d3d10misc.h \
	d3d10shader.h \
	d3d11shader.h \
	d3d8.h \
	d3d8caps.h \
	d3d8types.h \
	d3d9.h \
	d3d9caps.h \
	d3d9types.h \
	d3dcaps.h \
	d3dcompiler.h \
	d3dhal.h \
	d3drm.h \
	d3drmdef.h \
	d3drmobj.h \
	d3drmwin.h \
	d3dtypes.h \
	d3dvec.inl \
	d3dx9.h \
	d3dx9anim.h \
	d3dx9core.h \
	d3dx9effect.h \
	d3dx9math.h \
	d3dx9math.inl \
	d3dx9mesh.h \
	d3dx9shader.h \
	d3dx9shape.h \
	d3dx9tex.h \
	d3dx9xof.h \
	dbccmd.idl \
	dbcses.idl \
	dbdsad.idl \
	dbghelp.h \
	dbinit.idl \
	dbprop.idl \
	dbs.idl \
	dbt.h \
	dciddi.h \
	dciman.h \
	dcommon.h \
	dde.h \
	dde.rh \
	ddeml.h \
	ddk/compstui.h \
	ddk/hidsdi.h \
	ddk/imm.h \
	ddk/mountmgr.h \
	ddk/ntddcdvd.h \
	ddk/ntddk.h \
	ddk/ntddser.h \
	ddk/ntddtape.h \
	ddk/usb.h \
	ddk/usb100.h \
	ddk/usb200.h \
	ddk/usbdlib.h \
	ddk/wdm.h \
	ddk/winddiui.h \
	ddk/winsplp.h \
	ddraw.h \
	ddrawgdi.h \
	ddrawi.h \
	devenum.idl \
	devguid.h \
	devpkey.h \
	devpropdef.h \
	difxapi.h \
	digitalv.h \
	dinput.h \
	dinputd.h \
	dispdib.h \
	dlgs.h \
	dls1.h \
	dls2.h \
	dmdls.h \
	dmerror.h \
	dmksctrl.h \
	dmo.h \
	dmoreg.h \
	dmort.h \
	dmplugin.h \
	dmusbuff.h \
	dmusicc.h \
	dmusicf.h \
	dmusici.h \
	dmusics.h \
	dpaddr.h \
	dplay.h \
	dplay8.h \
	dplobby.h \
	dplobby8.h \
	dpnathlp.h \
	dsconf.h \
	dsgetdc.h \
	dshow.h \
	dsound.h \
	dsrole.h \
	dvdmedia.h \
	dwmapi.h \
	dxdiag.h \
	dxerr8.h \
	dxerr9.h \
	dxfile.h \
	dxgiformat.h \
	dxgitype.h \
	dyngraph.idl \
	errorrep.h \
	errors.h \
	evcode.h \
	evntprov.h \
	evntrace.h \
	excpt.h \
	exdispid.h \
	fci.h \
	fdi.h \
	fltdefs.h \
	gdiplus.h \
	gdipluscolor.h \
	gdipluscolormatrix.h \
	gdiplusenums.h \
	gdiplusflat.h \
	gdiplusgpstubs.h \
	gdiplusimaging.h \
	gdiplusinit.h \
	gdiplusmem.h \
	gdiplusmetaheader.h \
	gdipluspixelformats.h \
	gdiplustypes.h \
	guiddef.h \
	hlguids.h \
	htmlhelp.h \
	http.h \
	httprequestid.h \
	i_cryptasn1tls.h \
	icm.h \
	icmpapi.h \
	idispids.h \
	ifdef.h \
	ifmib.h \
	imagehlp.h \
	imm.h \
	in6addr.h \
	inaddr.h \
	initguid.h \
	intshcut.h \
	ipexport.h \
	iphlpapi.h \
	ipifcons.h \
	ipmib.h \
	iprtrmib.h \
	iptypes.h \
	isguids.h \
	knownfolders.h \
	ks.h \
	ksguid.h \
	ksmedia.h \
	lm.h \
	lmaccess.h \
	lmapibuf.h \
	lmat.h \
	lmbrowsr.h \
	lmcons.h \
	lmerr.h \
	lmjoin.h \
	lmmsg.h \
	lmserver.h \
	lmshare.h \
	lmstats.h \
	lmuse.h \
	lmuseflg.h \
	lmwksta.h \
	loadperf.h \
	lzexpand.h \
	mapi.h \
	mapicode.h \
	mapidefs.h \
	mapiform.h \
	mapiguid.h \
	mapitags.h \
	mapiutil.h \
	mapival.h \
	mapix.h \
	mciavi.h \
	mcx.h \
	mediaerr.h \
	midles.h \
	minmax.h \
	mmddk.h \
	mmreg.h \
	mmsystem.h \
	mprapi.h \
	mprerror.h \
	msacm.h \
	msacmdlg.h \
	msacmdrv.h \
	mscat.h \
	msdaguid.h \
	mshtmcid.h \
	mshtmdid.h \
	msi.h \
	msidefs.h \
	msiquery.h \
	mssip.h \
	mstcpip.h \
	msvcrt/assert.h \
	msvcrt/conio.h \
	msvcrt/crtdbg.h \
	msvcrt/crtdefs.h \
	msvcrt/ctype.h \
	msvcrt/direct.h \
	msvcrt/dirent.h \
	msvcrt/dos.h \
	msvcrt/eh.h \
	msvcrt/errno.h \
	msvcrt/fcntl.h \
	msvcrt/float.h \
	msvcrt/io.h \
	msvcrt/limits.h \
	msvcrt/locale.h \
	msvcrt/malloc.h \
	msvcrt/math.h \
	msvcrt/mbctype.h \
	msvcrt/mbstring.h \
	msvcrt/memory.h \
	msvcrt/process.h \
	msvcrt/search.h \
	msvcrt/setjmp.h \
	msvcrt/share.h \
	msvcrt/signal.h \
	msvcrt/stddef.h \
	msvcrt/stdio.h \
	msvcrt/stdlib.h \
	msvcrt/string.h \
	msvcrt/sys/locking.h \
	msvcrt/sys/stat.h \
	msvcrt/sys/timeb.h \
	msvcrt/sys/types.h \
	msvcrt/sys/unistd.h \
	msvcrt/sys/utime.h \
	msvcrt/time.h \
	msvcrt/unistd.h \
	msvcrt/wchar.h \
	msvcrt/wctype.h \
	mswsock.h \
	msxml2did.h \
	msxml6did.h \
	msxmldid.h \
	nb30.h \
	ndrtypes.h \
	nldef.h \
	npapi.h \
	nspapi.h \
	ntddcdrm.h \
	ntddndis.h \
	ntddscsi.h \
	ntddstor.h \
	ntdsapi.h \
	ntquery.h \
	ntsecapi.h \
	ntsecpkg.h \
	ntstatus.h \
	objbase.h \
	objsel.h \
	odbcinst.h \
	ole2.h \
	ole2ver.h \
	oleauto.h \
	olectl.h \
	oledberr.h \
	oledlg.h \
	opnrst.idl \
	patchapi.h \
	pdh.h \
	pdhmsg.h \
	pktdef.h \
	poppack.h \
	powrprof.h \
	profinfo.h \
	propkey.h \
	propkeydef.h \
	propvarutil.h \
	prsht.h \
	psapi.h \
	pshpack1.h \
	pshpack2.h \
	pshpack4.h \
	pshpack8.h \
	ras.h \
	rasdlg.h \
	raserror.h \
	reason.h \
	regstr.h \
	restartmanager.h \
	richedit.h \
	rmxfguid.h \
	row.idl \
	rowchg.idl \
	rpc.h \
	rpcasync.h \
	rpcdce.h \
	rpcdcep.h \
	rpcndr.h \
	rpcnterr.h \
	rpcproxy.h \
	rpcsal.h \
	rstbas.idl \
	rstinf.idl \
	rstloc.idl \
	rstnot.idl \
	rtutils.h \
	scarderr.h \
	schannel.h \
	schemadef.h \
	schnlsp.h \
	sddl.h \
	secext.h \
	security.h \
	sensapi.h \
	sesprp.idl \
	setupapi.h \
	sfc.h \
	shdispid.h \
	shellapi.h \
	shlguid.h \
	shlobj.h \
	shlwapi.h \
	sipbase.h \
	slerror.h \
	slpublic.h \
	snmp.h \
	softpub.h \
	sql.h \
	sqlext.h \
	sqltypes.h \
	srrestoreptapi.h \
	sspi.h \
	sti.h \
	storage.h \
	strsafe.h \
	svrapi.h \
	t2embapi.h \
	tapi.h \
	tchar.h \
	tcpmib.h \
	textserv.h \
	tlhelp32.h \
	tmschema.h \
	traffic.h \
	twain.h \
	udpmib.h \
	uiautomation.h \
	uiautomationcoreapi.h \
	userenv.h \
	usp10.h \
	uuids.h \
	uxtheme.h \
	vdmdbg.h \
	ver.h \
	verrsrc.h \
	vfw.h \
	vfwmsgs.h \
	vmrender.idl \
	vsstyle.h \
	vssym32.h \
	werapi.h \
	wfext.h \
	wia.h \
	winbase.h \
	wincon.h \
	wincred.h \
	wincrypt.h \
	windef.h \
	windns.h \
	windows.h \
	windowsx.h \
	wine/debug.h \
	wine/exception.h \
	wine/library.h \
	wine/unicode.h \
	winerror.h \
	winevt.h \
	wingdi.h \
	winhttp.h \
	wininet.h \
	winineti.h \
	winioctl.h \
	winldap.h \
	winnetwk.h \
	winnls.h \
	winnls32.h \
	winnt.h \
	winnt.rh \
	winperf.h \
	winreg.h \
	winresrc.h \
	winsafer.h \
	winscard.h \
	winsmcrd.h \
	winsock.h \
	winsock2.h \
	winspool.h \
	winsvc.h \
	wintab.h \
	wintabx.h \
	winternl.h \
	wintrust.h \
	winuser.h \
	winuser.rh \
	winver.h \
	wmistr.h \
	wnaspi32.h \
	wownt32.h \
	ws2def.h \
	ws2ipdef.h \
	ws2spi.h \
	ws2tcpip.h \
	wshisotp.h \
	wsipx.h \
	wsnwlink.h \
	wtsapi32.h \
	xcmc.h \
	xinput.h \
	xmldom.h \
	xmldom.idl \
	xmldomdid.h \
	xmldso.idl \
	xmldsodid.h \
	zmouse.h

EXTRASUBDIRS = \
	ddk \
	msvcrt \
	msvcrt/sys \
	wine

INSTALLDIRS = \
	$(DESTDIR)$(includedir)/windows/ddk \
	$(DESTDIR)$(includedir)/windows \
	$(DESTDIR)$(includedir)/msvcrt/sys \
	$(DESTDIR)$(includedir)/msvcrt \
	$(DESTDIR)$(includedir)

IDL_H_SRCS = $(PUBLIC_IDL_H_SRCS) $(PRIVATE_IDL_H_SRCS)

@MAKE_RULES@

OBJDIR_INCLUDES = $(PUBLIC_IDL_H_SRCS:.idl=.h) $(XTEMPLATE_SRCS:.x=.h)

all: $(IDL_H_SRCS:.idl=.h) $(IDL_TLB_SRCS:.idl=.tlb) $(XTEMPLATE_SRCS:.x=.h)

rmxftmpl.h: rmxftmpl.x $(MAKEXFTMPL)
	$(MAKEXFTMPL) -i D3DRM_XTEMPLATES -s D3DRM_XTEMPLATE_BYTES -o $@ $(srcdir)/rmxftmpl.x

install install-dev:: $(OBJDIR_INCLUDES) $(INSTALLDIRS)
	for f in $(SRCDIR_INCLUDES); do case $$f in \
	  wine/*)   $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
	  msvcrt/*) $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/$$f ;; \
	  *)        $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/windows/$$f ;; \
	esac; done
	for f in $(OBJDIR_INCLUDES); do case $$f in \
	  wine/*)   $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
	  msvcrt/*) $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/$$f ;; \
	  *)        $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/windows/$$f ;; \
	esac; done

# Don't just do a rm -rf on $(includedir) -- don't want to wipe out
# anything extra the user may have put there.
uninstall::
	for f in $(SRCDIR_INCLUDES) $(OBJDIR_INCLUDES); do case $$f in \
	  wine/*)   $(RM) $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \
	  msvcrt/*) $(RM) $(DESTDIR)$(includedir)/$$f ;; \
	  *)        $(RM) $(DESTDIR)$(includedir)/windows/$$f ;; \
	esac; done
	-rmdir $(INSTALLDIRS)
