
#  Dylan libraries for interfacing with the "common controls" of the
#  Win32 API (Microsoft Windows)
#
#  This file controls the generation of source files that are created
#  automatically by adapting information from the Microsoft header files.

WIN32-CONTROLS=commctrl.dylan prsht.dylan library.dylan

all: $(WIN32-CONTROLS)

controls: $(WIN32-CONTROLS)

COMDIR=../win32-common

include $(COMDIR)/sources.mak


library.dylan: library.src commctrl.exp prsht.exp 

commctrl.dylan: $(MSH)commctrl.h $(PATTERNS) more.pat inherited-slots.pat \
			$(COMDIR)/callback.pat
	$(GEMA) -f more.pat -f $(PATTERNS) -f inherited-slots.pat \
		-f $(COMDIR)/callback.pat \
		-f $(COMDIR)/modcopyr.pat  -module Win32-controls \
		-in $(MSH)commctrl.h  -out $@

prsht.dylan: $(MSH)prsht.h $(PATTERNS) more.pat inherited-slots.pat \
			$(COMDIR)/callback.pat
	$(GEMA) -f more.pat -f $(PATTERNS) -f inherited-slots.pat \
		-f $(COMDIR)/callback.pat \
		-f $(COMDIR)/modcopyr.pat  -module Win32-controls \
		-in $(MSH)prsht.h  -out $@

# This notes which slot accessors should not be exported here because the
# name is inherited from another module:
inherited-slots.pat: library.src
	$(GEMA) -match -idchars '_-$$<>@%&*+=/?' \
	  -p '\Iexport\:\W\{<exports>\}=$$1' \
	  -p 'exports:<I>-value-setter\I=export-slot\:\\C$$1\=\$$0-value\@end\n;<I>=;?=' \
	  -in library.src -out $@

TAGS: $(WIN32-CONTROLS) special.dylan
	dtags $(WIN32-CONTROLS) special.dylan

tags: TAGS

clean:
	rm -f $(WIN32-CONTROLS) *.bak *.exp inherited-slots.pat TAGS
