Create static library instead of shred object

Vadim Idelchuk vadimi at storwize.com
Wed Jun 3 05:35:19 EDT 2009


 Hi,

I need to use static form of library.
The following are changes in lib/Makefile

@@ -39,12 +39,7 @@
 ROUTE_LIB := $(PACKAGE_NAME)-route.so
 GENL_LIB  := $(PACKAGE_NAME)-genl.so
 NF_LIB    := $(PACKAGE_NAME)-nf.so
-CORE_SLIB  := $(PACKAGE_NAME).a
-ROUTE_SLIB := $(PACKAGE_NAME)-route.a
-GENL_SLIB  := $(PACKAGE_NAME)-genl.a
-NF_SLIB    := $(PACKAGE_NAME)-nf.a
-LIBS      := $(CORE_LIB) $(ROUTE_LIB) $(GENL_LIB) $(NF_LIB) \
-               $(CORE_SLIB) $(ROUTE_SLIB) $(GENL_SLIB) $(NF_SLIB)
+LIBS      := $(CORE_LIB) $(ROUTE_LIB) $(GENL_LIB) $(NF_LIB)
 LIBS_V    := $(LIBS:%.so=%.so.$(PACKAGE_VERSION))

 export
@@ -59,10 +54,6 @@
        @echo "  LD $@"; \
        $(CC) -shared -Wl,-soname=$@ -o $@ $^ $(LIBNL_LIB)

-$(CORE_SLIB): $(CORE_OBJ)
-       @echo "AR cr $@ $^";\
-       $(AR) cr $@ $^
-
 $(CORE_LIB): $(CORE_LIB).$(PACKAGE_VERSION)
        @echo "  LN $@ -> $<"; \
        $(RM) -f $@; $(LN) $< -s $@
@@ -71,10 +62,6 @@
        @echo "  LD $@"; \
        $(CC) -shared -Wl,-soname=$@ -o $@ $^ $(LIBNL_LIB) -lnl

-$(ROUTE_SLIB): $(ROUTE_OBJ) $(CORE_SLIB)
-       @echo "AR cr $@ $^ $(CORE_SLIB)";\
-       $(AR) cr $@ $^ $(CORE_SLIB)
-
 $(ROUTE_LIB): $(ROUTE_LIB).$(PACKAGE_VERSION)
        @echo "  LN $@ -> $<"; \
        $(RM) -f $@; $(LN) $< -s $@
@@ -83,10 +70,6 @@
        @echo "  LD $@"; \
        $(CC) -shared -Wl,-soname=$@ -o $@ $^ $(LIBNL_LIB) -lnl

-$(GENL_SLIB): $(GENL_OBJ) $(CORE_SLIB)
-       @echo "AR cr $@ $^ $(CORE_SLIB)";\
-       $(AR) cr $@ $^ $(CORE_SLIB)
-
 $(GENL_LIB): $(GENL_LIB).$(PACKAGE_VERSION)
        @echo "  LN $@ -> $<"; \
        $(RM) -f $@; $(LN) $< -s $@
@@ -95,10 +78,6 @@
        @echo "  LD $@"; \
        $(CC) -shared -Wl,-soname=$@ -o $@ $^ $(LIBNL_LIB) -lnl
-lnl-route

-$(NF_SLIB): $(NF_OBJ) $(CORE_SLIB) $(ROUTE_SLIB)
-       @echo "AR cr $@ $^ $(CORE_SLIB) $(ROUTE_SLIB)";\
-       $(AR) cr $@ $^ $(CORE_SLIB) $(ROUTE_SLIB)
-
 $(NF_LIB): $(NF_LIB).$(PACKAGE_VERSION)
        @echo "  LN $@ -> $<"; \
        $(RM) -f $@; $(LN) $< -s $@
 
Vadim Idelchuk
03-5391617
vadimi at storwize.com 



More information about the libnl mailing list