OSDN Git Service

add asm test
[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         abcType
12         lowInst
13         asm
14
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(label   , label)
30 OUnitTest(bytes   , bytes label)
31 OUnitTest(lowInst , lowInst bytes)
32 OUnitTest(asm     , asm label bytes)
33 #OUnitTest(revList , revList)
34 #OUnitTest(cpool   , cpool revList)
35 #OUnitTest(asm     , bytes asm cpool revList)
36
37 # phony
38 .PHONY: clean
39 .DEFAULT: $(MyOCamlPackage $(PROGRAM), $(FILES))
40
41 write.h: gen_inst$(EXE) instruction.txt
42     ./gen_inst$(EXE) -writer < instruction.txt > $@
43
44 type.h: gen_inst$(EXE) instruction.txt
45     ./gen_inst$(EXE) -type < instruction.txt > $@
46
47 low_type.h: gen_typemap$(EXE)
48     ./gen_typemap$(EXE) -low > $@
49
50 high_type.h: gen_typemap$(EXE)
51     ./gen_typemap$(EXE) -high > $@
52
53 .SCANNER: %.ml : %.mlp
54     grep "#include \"" $< | sed 's/.*"\(.*\)".*/'$@': \1/'
55
56 clean:
57     ocaml-clean *.h lowInst.ml gen_inst$(EXE) gen_typemap$(EXE)