XML2RFC = xml2rfc

LIBSMI	= $(HOME)/src/libsmi
SMIDUMP = $(LIBSMI)/tools/smidump
MIBS	= $(LIBSMI)/mibs
SMIPATH = $(MIBS)/ietf:$(MIBS)/iana
IETF	= $(shell ls -1 $(MIBS)/ietf | egrep -v 'Makefile')
IANA	= $(shell ls -1 $(MIBS)/iana | egrep -v 'Makefile')

ALL	= ietf-tc-list.txt ietf-tc-list.html \
	  iana-tc-list.txt iana-tc-list.html

export SMIPATH

all: $(ALL)

%.txt: %.xml
	$(XML2RFC) $< $@

%.html: %.xml
	$(XML2RFC) $< $@

ietf-tc-list.xml:
	$(SMIDUMP) -k -c /dev/null -f ietf --ietf-type-list --ietf-xml2rfc \
		$(IETF) > ietf-tc-list.xml

iana-tc-list.xml:
	$(SMIDUMP) -k -c /dev/null -f ietf --ietf-type-list --ietf-xml2rfc \
		$(IANA) > iana-tc-list.xml

clean:
	rm -f ietf-tc-list.xml iana-tc-list.xml

clobber:
	rm -f ietf-tc-list.* iana-tc-list.*
