# Makefile for the AF manpages.
MANDIR = $(LIBMANDIR)
MANSUFFIX = $(LIBMANSUFFIX)

# Manual pages are currently listed twice. "Real" pages are listed
# MANPAGES and with an 'InstallManPage()' command.
# Aliases (i.e., multiple entries on the same page) are listed in
# an 'InstallManPageAliases()' command.

MANPAGES = AFAddHost.man \
	AFConnName.man \
	AFCreateAC.man \
	AFCPAC.man \
	AFDial.man \
	AFEInput.man \
	AFEPThru.man \
	AFFlush.man \
	AFGetEText.man \
	AFGProp.man \
	AFGetTime.man \
	AFHook.man \
	AFIfEvent.man \
	AFAtom.man \
	AFNEvent.man \
	AFNoOp.man \
	AFOConn.man \
	AFPSamp.man \
	AFQIGain.man \
	AFPhone.man \
	AFRSamp.man \
	AFSEvents.man \
	AFSynch.man \
	AFree.man \
	AADDesc.man \
        libAF.man


#if ExpandManNames

# Note: no commas in the aliases list!

InstallManPageLong(AFOConn, $(MANDIR),AFOpenAudioConn)
InstallManPageAliases(AFOpenAudioConn, $(MANDIR), AFCloseAudioConn)
InstallManPageLong(AFConnName, $(MANDIR),AFAudioConnName)
InstallManPageLong(AFCPAC, $(MANDIR),AFCreatePhoneAC)
InstallManPageLong(AFDial, $(MANDIR),AFDialPhone)
InstallManPageLong(AFGProp, $(MANDIR),AFGetProperty)
InstallManPageAliases(AFGetProperty, $(MANDIR), AFListProperties AFChangeProperty AFDeleteProperty)
InstallManPageLong(AFEInput, $(MANDIR),AFEnableInput)
InstallManPageAliases(AFEnableInput, $(MANDIR), AFDisableInput AFEnableOutput AFDisableOutput)
InstallManPageLong(AFGetEText, $(MANDIR),AFGetErrorText)
InstallManPageAliases(AFGetErrorText, $(MANDIR), AFSetErrorHandler AFSetIOErrorHandler AFGetErrorDatabaseText)
InstallManPageLong(AFHook, $(MANDIR),AFHookSwitch)
InstallManPageAliases(AFHookSwitch, $(MANDIR), AFFlashHook)
InstallManPageLong(AFNEvent, $(MANDIR),AFNextEvent)
InstallManPageLong(AFAtom, $(MANDIR),AFInternAtom)
InstallManPageAliases(AFInternAtom, $(MANDIR), AFGetAtomName)
InstallManPageLong(AFPSamp, $(MANDIR),AFPlaySamples)
InstallManPageLong(AFQIGain, $(MANDIR),AFQueryInputGain)
InstallManPageAliases(AFQueryInputGain, $(MANDIR), AFQueryOutputGain AFSetInputGain AFSetOutputGain)
InstallManPageLong(AFPhone, $(MANDIR),AFQueryPhone)
InstallManPageLong(AFRSamp, $(MANDIR),AFRecordSamples)
InstallManPageLong(AFSEvents, $(MANDIR),AFSelectEvents)
InstallManPageLong(AFEPThru, $(MANDIR),AFEnablePassThrough)
InstallManPageAliases(AFEnablePassThrough, $(MANDIR), AFDisablePassThrough)
InstallManPageLong(AFSynch, $(MANDIR),AFSynchronize)
InstallManPageAliases(AFSynchronize, $(MANDIR), AFSetAfterFunction)
InstallManPageLong(AADDesc, $(MANDIR),AAudioDeviceDescriptor)

InstallManPage(AFAddHost, $(MANDIR))
InstallManPageAliases(AFAddHost, $(MANDIR), AFAddHosts AFListHosts AFRemoveHost AFRemoveHosts AFSetAccessControl AFEnableAccessControl AFDisableAccessControl  AFHostAddress)
InstallManPage(AFCreateAC, $(MANDIR))
InstallManPageAliases(AFCreateAC, $(MANDIR), AFChangeACAttributes AFFreeAC)
InstallManPage(AFGetTime, $(MANDIR))
InstallManPage(AFFlush, $(MANDIR))
InstallManPageAliases(AFFlush, $(MANDIR), AFSync AFEventsQueued AFPending)
InstallManPage(AFIfEvent, $(MANDIR))
InstallManPageAliases(AFIfEvent, $(MANDIR), AFCheckIfEvent AFPeekIfEvent)
InstallManPage(AFNoOp, $(MANDIR))
InstallManPage(AFree, $(MANDIR))
InstallManPage(libAF, $(MANDIR))

#else

InstallManPage(AFOConn, $(MANDIR))
InstallManPageAliases(AFOpenAudioConn, $(MANDIR), AFCloseAudioConn)
InstallManPage(AFConnName, $(MANDIR))
InstallManPage(AFCPAC, $(MANDIR))
InstallManPage(AFDial, $(MANDIR))
InstallManPage(AFGProp, $(MANDIR))
InstallManPageAliases(AFGetProperty, $(MANDIR), AFListProperties AFChangeProperty AFDeleteProperty)
InstallManPage(AFEInput, $(MANDIR))
InstallManPageAliases(AFEnableInput, $(MANDIR), AFDisableInput AFEnableOutput AFDisableOutput)
InstallManPage(AFGetEText, $(MANDIR))
InstallManPageAliases(AFGetErrorText, $(MANDIR), AFSetErrorHandler AFSetIOErrorHandler AFGetErrorDatabaseText)
InstallManPage(AFHook, $(MANDIR))
InstallManPageAliases(AFHookSwitch, $(MANDIR), AFFlashHook)
InstallManPage(AFNEvent, $(MANDIR))
InstallManPage(AFAtom, $(MANDIR))
InstallManPageAliases(AFInternAtom, $(MANDIR), AFGetAtomName)
InstallManPage(AFPSamp, $(MANDIR))
InstallManPage(AFQIGain, $(MANDIR))
InstallManPageAliases(AFQueryInputGain, $(MANDIR), AFQueryOutputGain AFSetInputGain AFSetOutputGain)
InstallManPage(AFPhone, $(MANDIR))
InstallManPage(AFRSamp, $(MANDIR))
InstallManPage(AFSEvents, $(MANDIR))
InstallManPage(AFEPThru, $(MANDIR))
InstallManPageAliases(AFEnablePassThrough, $(MANDIR), AFDisablePassThrough)
InstallManPage(AFSynch, $(MANDIR))
InstallManPageAliases(AFSynchronize, $(MANDIR), AFSetAfterFunction)
InstallManPage(AADDesc, $(MANDIR))

InstallManPage(AFAddHost, $(MANDIR))
InstallManPageAliases(AFAddHost, $(MANDIR), AFAddHosts AFListHosts AFRemoveHost AFRemoveHosts AFSetAccessControl AFEnableAccessControl AFDisableAccessControl  AFHostAddress)
InstallManPage(AFCreateAC, $(MANDIR))
InstallManPageAliases(AFCreateAC, $(MANDIR), AFChangeACAttributes AFFreeAC)
InstallManPage(AFGetTime, $(MANDIR))
InstallManPage(AFFlush, $(MANDIR))
InstallManPageAliases(AFFlush, $(MANDIR), AFSync AFEventsQueued AFPending)
InstallManPage(AFIfEvent, $(MANDIR))
InstallManPageAliases(AFIfEvent, $(MANDIR), AFCheckIfEvent AFPeekIfEvent)
InstallManPage(AFNoOp, $(MANDIR))
InstallManPage(AFree, $(MANDIR))
InstallManPage(libAF, $(MANDIR))

#endif

TROFF= groff
PRINTER= lpr
INSTALLFLAGS = $(INSTMANFLAGS)

all: # nothing to do

PS:
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(MANPAGES) ; \
	do \
	echo formatting $$i ; \
	tbl $$i  | $(TROFF) -man -t - > `basename $$i .3AF`.ps ; \
	done

onePS:
	tbl $(MANPAGES)  | $(TROFF) -man - > $(FILE).ps


techreport:
	tbl $(MANPAGES)  | $(TROFF) -man crltr intro.r - > AF-manual.ps

clean::
	rm -f *.PS *.ps

# InstallMultipleMan($(MANPAGES),$(LIBMANDIR))

depend:
