1 .PHONY: default all clean drivers
3 include $(XSEG_HOME)/base.mk
9 DRIVERS=xseg_posix xseg_segdev
10 DRVDIR=$(BASE)/drivers/user
11 DRVOBJS=$(addsuffix .o, $(addprefix $(DRVDIR)/, $(DRIVERS)))
16 all: libxseg.a libxseg.so
21 _initialize.c: drivers
22 $(BASE)/tools/create_initializer $(DRIVERS) > _initialize.c
24 xseg.o: $(BASE)/xseg/xseg.c $(BASE)/xseg/xseg.h $(BASE)/xq/xq.h
25 $(CC) $(CFLAGS) $(INC) -c -o $@ $<
27 xseg.pic.o: $(BASE)/xseg/xseg.c $(BASE)/xseg/xseg.h _initialize.c
28 $(CC) $(CFLAGS) $(INC) -fPIC -c -o $@ $<
30 libxseg.so: libxseg.so.$(MAJOR)
34 libxseg.so.$(MAJOR): libxseg.so.$(MAJOR).$(MINOR)
39 make -C $(DRVDIR) $(addsuffix .o, $(DRIVERS))
47 xseg_user.o: xseg_user.c
48 $(CC) $(CFLAGS) $(INC) -Wall -O2 -finline-functions -fPIC -c -o $@ $<
50 libxseg.map: $(BASE)/xq/xq_exports.h $(BASE)/xseg/xseg_exports.h
51 cat $(BASE)/xq/xq_exports.h $(BASE)/xseg/xseg_exports.h | ./make_symbol_map.sh > $@
53 libxseg.so.$(MAJOR).$(MINOR): xseg.pic.o xseg_user.o libxseg.map \
54 xq/xq.pic.o $(DRVOBJS)
55 $(CC) $(CFLAGS) -shared \
56 -Wl,-soname=libxseg.so.$(MAJOR) \
57 -o libxseg.so.$(MAJOR).$(MINOR) \
58 xseg.pic.o xseg_user.o xq/xq.pic.o \
59 _initialize.o $(DRVOBJS) \
60 -Wl,--version-script=libxseg.map \
64 libxseg.a: xseg.o xq/xq.o drivers _initialize.o
65 $(AR) r libxseg.a xseg.o xq/xq.o _initialize.o $(DRVOBJS)
71 rm -f _initialize.c _initialize.o
72 rm -f xseg.o xseg.pic.o xseg_user.o
73 rm -f libxseg.a libxseg.map
74 rm -f libxseg.so libxseg.so.$(MAJOR) libxseg.so.$(MAJOR).$(MINOR)