OSDN Git Service

5445e1c710dd85782bdbe673a36403b4d5a955e7
[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         swfType
26         swfOut
27         swf
28
29 UseCamlp4(pa_openin pa_oo pa_field)
30 PROGRAM=../swflib
31
32 OCAMLINCLUDES += $(ROOT)/base
33 OCAML_LIBS    += $(ROOT)/base/base
34
35 OCAMLOPT   = ocamlopt -for-pack $(capitalize $(basename $(PROGRAM)))
36 OCAMLOPTLINK= ocamlopt
37
38 .DEFAULT: $(MyOCamlPackage $(PROGRAM), $(FILES))
39
40 OCamlProgram(gen_inst,gen_inst)
41 OCamlProgram(gen_typemap,gen_typemap)
42 OCamlProgram(main, main $(FILES))
43
44 # test
45 OUnitTest(label    , label)
46 OUnitTest(bytesOut , bytesOut label)
47 OUnitTest(bytesIn  , bytesIn)
48 OUnitTest(abcIn    , abcIn bytesIn bytesOut)
49 OUnitTest(lowInst  , lowInst bytesOut bytesIn label)
50 OUnitTest(highInst , highInst label cpool revList)
51 OUnitTest(abcOut   , abcOut label bytesOut)
52 OUnitTest(methodOut, methodOut cpool bytesOut label revList)
53 OUnitTest(revList  , revList)
54 OUnitTest(cpool    , cpool revList)
55
56 OUnitTest(swfOut, swfOut swfBaseOut bitsOut)
57 OUnitTest(tagOut, tagOut)
58 OUnitTest(swfBaseOut, swfBaseOut bitsOut)
59 OUnitTest(bitsOut, bitsOut)
60
61 # phony
62 .PHONY: clean
63
64 %.type.h: gen_typemap$(EXE)
65         ./gen_typemap$(EXE) -$> > $@
66
67 %.inst.h: gen_inst$(EXE) instruction.txt
68      ./gen_inst$(EXE) -$> < instruction.txt > $@
69
70 %.tag.h: gen_inst$(EXE) tag.txt
71      ./gen_inst$(EXE) -$> < tag.txt > $@
72
73 %.pat.h: gen_inst$(EXE) instruction.txt
74      ./gen_inst$(EXE) -pat $> < instruction.txt > $@
75
76 %.extra.h: gen_inst$(EXE) instruction.txt
77      ./gen_inst$(EXE) -extra $> < instruction.txt > $@
78
79 .SCANNER: %.ml : %.mlp
80     (grep "#include \"" $<;true) | sed 's/.*"\(.*\)".*/'$@': \1/'
81
82 clean:
83     ocaml-clean *.h lowInst.ml gen_inst$(EXE) gen_typemap$(EXE)