forked from gdslang/gdsl-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_mips
55 lines (42 loc) · 3.01 KB
/
Makefile_mips
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
MLTK=.
CC=gcc
MLTON=mlton
MLTONFLAGS=
CFLAGS=-g3 -fPIC -Wall -Iinclude
LFLAGS=-shared
include mips.mk
#GDSL=gdsl
GDSL_MEX=_manual
GDSL_COMP=$(GDSL)$(GDSL_MEX)
GDSL_EXEC=$(GDSL)c
GPREFIX=
GDSLFLAGS=--maxIter=45
GDSL_BASIS_HL=specifications/basis/prelude.ml specifications/basis/bbtree.ml
#GDSL_RREIL_EMIT_HL=specifications/rreil/rreil-emit.ml specifications/rreil/rreil-examples.ml specifications/rreil/rreil-cif.ml specifications/rreil/rreil-pretty.ml specifications/rreil/fmap.ml
#GDSL_RREIL_DECL_HL=specifications/rreil/rreil-decl.ml
GDSL_ASM_HL=specifications/asm/asm.ml specifications/asm/asm-pretty.ml specifications/asm/asm-cif.ml
GDSL_RREIL_HL=specifications/rreil/rreil.ml specifications/rreil/rreil-examples.ml specifications/rreil/rreil-cif.ml specifications/rreil/rreil-pretty.ml specifications/rreil/fmap.ml specifications/rreil/rreil-opt.ml specifications/rreil/rreil-translator.ml
GDSL_OPT_HL=specifications/rreil/rreil-liveness.ml specifications/rreil/rreil-forward-subst.ml specifications/rreil/forward-subst/delayed-forward-subst/inline.ml specifications/rreil/forward-subst/delayed-forward-subst/substitute.ml specifications/rreil/forward-subst/delayed-forward-subst/substmap.ml specifications/rreil/forward-subst/forward-subst/inline.ml specifications/rreil/forward-subst/forward-subst/substitute.ml specifications/rreil/forward-subst/forward-subst/substmap.ml specifications/rreil/forward-subst/forward-subst/simplify-expressions.ml specifications/rreil/rreil-cleanup.ml
GDSL_MIPS_HL_R5=specifications/mips/mips_r5.ml specifications/mips/mips-pretty_r5.ml specifications/mips/mips-rreil-translator_r5.ml specifications/mips/mips-asm_r5.ml specifications/mips/mips-traverse_r5.ml
GDSL_MIPS_HL_R6=specifications/mips/mips_r6.ml specifications/mips/mips-pretty_r6.ml specifications/mips/mips-rreil-translator_r6.ml specifications/mips/mips-asm_r6.ml specifications/mips/mips-traverse_r6.ml
GDSL_MIPS_HL=specifications/mips/mips.ml specifications/mips/mips-pretty.ml specifications/mips/mips-rreil-pretty.ml specifications/mips/mips-rreil-registermapping.ml specifications/mips/mips-rreil-translator.ml specifications/mips/mips-liveness.ml specifications/mips/mips-asm.ml specifications/mips/mips-traverse.ml $(GDSL_MIPS_HL_R6)
GDSL_MIPS_TRANS_HL=
GDSL_SOURCES=$(GDSL_BASIS_HL) $(GDSL_RREIL_HL) $(GDSL_MIPS_HL) $(GDSL_MIPS_TRANS_HL) $(GDSL_OPT_HL) $(GDSL_ASM_HL)
.PHONY: libs tools
all: $(GDSL_EXEC) lib$(GDSL).so libs tools
$(GDSL_EXEC): $(GDSL_EXEC).mlb $(shell find detail/ -type f -name '*')
$(MLTON) $(MLTONFLAGS) $<
lib$(GDSL).so: $(GDSL_COMP).c
$(CC) $(CFLAGS) -c $< -o $(<:$(GDSL_MEX).c=.o)
$(CC) $(LFLAGS) -o lib$(<:$(GDSL_MEX).c=.so) $(<:$(GDSL_MEX).c=.o)
# $(CC) $(LFLAGS) -Wl,-soname,lib$(<:.c=.so) -o lib$(<:.c=.so) $(<:.c=.o)
$(GDSL_COMP).c: $(GDSL_EXEC) $(GDSL_SOURCES)
./$< -o $(GDSL_COMP) $(GDSLFLAGS) $(GDSL_SOURCES:%="%")
tools: lib$(GDSL).so libs
$(MAKE) -C $@/
libs: lib$(GDSL).so
$(MAKE) -C $@/
clean:
$(MAKE) -C libs/ clean
$(MAKE) -C tools/ clean
rm -f $(GDSL_EXEC) $(GDSL).o $(GDSL_COMP).c $(GDSL_COMP).h lib$(GDSL).so