OSDN Git Service

b75e1a6e8631a43a977a401068fcb4f0a85ac0c8
[happyabc/happyabc.git] / swflib / OMakefile
1 # build
2 OCAMLPACKS[] =
3         extlib
4         xml-light
5         oUnit
6         str
7
8 FILES[] =
9         bytes
10         label
11         instruction
12         abcType
13         asm
14         abc
15
16 UseCamlp4(pa_openin pa_oo)
17 PROGRAM=../swflib
18
19 OCAMLINCLUDES += $(ROOT)/base
20 OCAML_LIBS    += $(ROOT)/base/base
21
22 OCAMLOPT   = ocamlopt -for-pack $(capitalize $(basename $(PROGRAM)))
23 OCAMLOPTLINK= ocamlopt
24
25 OCamlProgram(gen_inst,gen_inst)
26 OCamlProgram(gen_typemap,gen_typemap)
27
28 # test
29 OUnitTest(bytes   , bytes label)
30 OUnitTest(abc     , bytes abc label)
31 OUnitTest(revList , revList)
32 OUnitTest(cpool   , cpool revList)
33 OUnitTest(asm     , bytes asm cpool revList)
34
35 # phony
36 .PHONY: clean
37 .DEFAULT: $(MyOCamlPackage $(PROGRAM), $(FILES))
38 write.h: gen_inst$(EXE) instruction.txt
39     ./gen_inst$(EXE) -writer < instruction.txt > $@
40
41 type.h: gen_inst$(EXE) instruction.txt
42     ./gen_inst$(EXE) -type < instruction.txt > $@
43
44 write_type.h: gen_typemap$(EXE)
45     ./gen_typemap$(EXE) -writer > $@
46
47 .SCANNER: instruction.ml : instruction.mlp
48     grep "#include \"" $< | sed 's/.*"\(.*\)".*/'$@': \1/'
49
50 clean:
51         ocaml-clean opcode.h match_body.h instruction.ml gen_inst$(EXE) gen_typemap$(EXE)