RPA Toolkit
merge the work on extended ops
[rpatk.git] / rvm / build / linux / rvm.mk
1 RVM_SRCDIR = $(SRCDIR)/rvm
2 RVM_LIB = $(OUTDIR)/librvm.a
3 RVM_SO = $(OUTDIR)/librvm.so.1.0
4
5 CFLAGS += -I$(RVM_SRCDIR)/config -I$(SRCDIR)/rlib
6
7 RVM_OBJECTS =   \
8         $(OUTDIR)/rrefreg.o \
9         $(OUTDIR)/rvmcpu.o \
10         $(OUTDIR)/rvmoperator.o \
11         $(OUTDIR)/rvmoperatorcast.o \
12         $(OUTDIR)/rvmoperatorcat.o \
13         $(OUTDIR)/rvmoperatoradd.o \
14         $(OUTDIR)/rvmoperatorsub.o \
15         $(OUTDIR)/rvmoperatormul.o \
16         $(OUTDIR)/rvmoperatordiv.o \
17         $(OUTDIR)/rvmcodemap.o \
18         $(OUTDIR)/rvmcodegen.o \
19         $(OUTDIR)/rvmreg.o \
20         $(OUTDIR)/rvmscope.o \
21
22
23 ifeq ($(OS), linux)
24 all: $(OUTDIR) $(RVM_LIB) $(RVM_SO)
25 else
26 all: $(OUTDIR) $(RVM_LIB)
27 endif
28
29
30 $(OUTDIR)/%.o: $(RVM_SRCDIR)/%.c
31         $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(RVM_SRCDIR)/$*.c
32
33 $(RVM_LIB): $(RVM_OBJECTS)
34         $(AR) -cr $@ $^
35
36 $(RVM_SO): $(RVM_OBJECTS)
37         $(CC) $(LDFLAGS) -shared -Wl,-soname,librvm.so -o $@ $^
38
39 $(OUTDIR):
40         @mkdir $(OUTDIR)
41
42 distclean: clean
43         @rm -f .depend
44         @rm -rf $(OUTDIR)
45
46 clean:
47         @rm -f $(RVM_LIB)
48         @rm -f $(RVM_SO)
49         @rm -f $(RVM_OBJECTS)
50         @rm -f *~
51         @rm -f $(SRCDIR)/*~
52