
ASMS = $(wildcard *.s)
SRC = $(wildcard *.c)

all:
	$(MAKE) -f Makefile-x86 all
	$(MAKE) -f Makefile-MIPS all
	$(MAKE) index.html $(subst .c,.html,$(SRC))

instructionList.txt: $(ASMS)
	cat $^ | perl -ne 'if (/\s+(\w+)/) {print "$$1\n";}' | sort | uniq > $@

index.html:  generateDoc.pl
	./generateDoc.pl > index.html

clean:	
	rm -f *.s instructionList.txt index.html 
	rm -rf *.tgz
	rm -rf *.exe 
	rm -rf *~

%.html:%.c ./generateHTML.pl
	./generateHTML.pl $<

tar:
	rm  -f *.exe
	(cd ..; tar czf $(PWD)/$(notdir $(PWD)).tgz $(notdir $(PWD)))