OSDN Git Service

Move common type definition(e.g. rect,mtarix) move to SwfBaseType module.
[happyabc/happyabc.git] / swflib / OMakefile
1 # build
2 OCAMLPACKS[] =
3         extlib
4         xml-light
5         oUnit
6         str
7
8 FILES[] =
9         label
10         bytesOut
11         bytesIn
12         abcType
13         abcOut
14         abcIn
15         lowInst
16         highInst
17         methodType
18         methodOut
19         cpool
20         revList
21         abc
22         bitsOut
23         tagOut
24         swfBaseOut
25         swfBaseType
26         swfType
27         swfOut
28         swf
29
30 UseCamlp4(pa_openin pa_oo pa_field)
31 PROGRAM=../swflib
32
33 OCAMLINCLUDES += $(ROOT)/base
34 OCAML_LIBS    += $(ROOT)/base/base
35
36 OCAMLOPT   = ocamlopt -for-pack $(capitalize $(basename $(PROGRAM)))
37 OCAMLOPTLINK= ocamlopt
38
39 .DEFAULT: $(MyOCamlPackage $(PROGRAM), $(FILES))
40
41 OCamlProgram(gen_inst,gen_inst)
42 OCamlProgram(gen_typemap,gen_typemap)
43 OCamlProgram(main, main $(FILES))
44
45 # test
46 OUnitTest(label    , label)
47 OUnitTest(bytesOut , bytesOut label)
48 OUnitTest(bytesIn  , bytesIn)
49 OUnitTest(abcIn    , abcIn bytesIn bytesOut)
50 OUnitTest(lowInst  , lowInst bytesOut bytesIn label)
51 OUnitTest(highInst , highInst label cpool revList)
52 OUnitTest(abcOut   , abcOut label bytesOut)
53 OUnitTest(methodOut, methodOut cpool bytesOut label revList)
54 OUnitTest(revList  , revList)
55 OUnitTest(cpool    , cpool revList)
56
57 OUnitTest(swfOut, swfOut swfBaseOut bitsOut)
58 OUnitTest(tagOut, tagOut)
59 OUnitTest(swfBaseOut, swfBaseOut bitsOut)
60 OUnitTest(bitsOut, bitsOut)
61
62 # phony
63 .PHONY: clean
64
65 %.type.h: gen_typemap$(EXE)
66         ./gen_typemap$(EXE) -$> > $@
67
68 %.inst.h: gen_inst$(EXE) instruction.txt
69      ./gen_inst$(EXE) -$> < instruction.txt > $@
70
71 %.tag.h: gen_inst$(EXE) tag.txt
72      ./gen_inst$(EXE) -$> < tag.txt > $@
73
74 %.pat.h: gen_inst$(EXE) instruction.txt
75      ./gen_inst$(EXE) -pat $> < instruction.txt > $@
76
77 %.extra.h: gen_inst$(EXE) instruction.txt
78      ./gen_inst$(EXE) -extra $> < instruction.txt > $@
79
80 .SCANNER: %.ml : %.mlp
81     (grep "#include \"" $<;true) | sed 's/.*"\(.*\)".*/'$@': \1/'
82
83 clean:
84     ocaml-clean *.h lowInst.ml gen_inst$(EXE) gen_typemap$(EXE)