# build OCAMLPACKS[] = extlib xml-light oUnit str FILES[] = label bytesOut bytesIn abcType abcOut abcIn lowInst highInst methodType methodOut cpool revList abc bitsOut tagOut swfBaseOut swfType swfOut UseCamlp4(pa_openin pa_oo pa_field) PROGRAM=../swflib OCAMLINCLUDES += $(ROOT)/base OCAML_LIBS += $(ROOT)/base/base OCAMLOPT = ocamlopt -for-pack $(capitalize $(basename $(PROGRAM))) OCAMLOPTLINK= ocamlopt .DEFAULT: $(MyOCamlPackage $(PROGRAM), $(FILES)) OCamlProgram(gen_inst,gen_inst) OCamlProgram(gen_typemap,gen_typemap) OCamlProgram(main, main $(FILES)) # test OUnitTest(label , label) OUnitTest(bytesOut , bytesOut label) OUnitTest(bytesIn , bytesIn) OUnitTest(abcIn , abcIn bytesIn bytesOut) OUnitTest(lowInst , lowInst bytesOut bytesIn label) OUnitTest(highInst , highInst label cpool revList) OUnitTest(abcOut , abcOut label bytesOut) OUnitTest(methodOut, methodOut cpool bytesOut label revList) OUnitTest(revList , revList) OUnitTest(cpool , cpool revList) OUnitTest(swfOut, swfOut swfBaseOut bitsOut) OUnitTest(tagOut, tagOut) OUnitTest(swfBaseOut, swfBaseOut bitsOut) OUnitTest(bitsOut, bitsOut) # phony .PHONY: clean %.type.h: gen_typemap$(EXE) ./gen_typemap$(EXE) -$> > $@ %.inst.h: gen_inst$(EXE) instruction.txt ./gen_inst$(EXE) -$> < instruction.txt > $@ %.tag.h: gen_inst$(EXE) tag.txt ./gen_inst$(EXE) -$> < tag.txt > $@ %.pat.h: gen_inst$(EXE) instruction.txt ./gen_inst$(EXE) -pat $> < instruction.txt > $@ %.extra.h: gen_inst$(EXE) instruction.txt ./gen_inst$(EXE) -extra $> < instruction.txt > $@ .SCANNER: %.ml : %.mlp (grep "#include \"" $<;true) | sed 's/.*"\(.*\)".*/'$@': \1/' clean: ocaml-clean *.h lowInst.ml gen_inst$(EXE) gen_typemap$(EXE)