]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Build atm and netem as shared libraries
authorosdl.net!shemminger <osdl.net!shemminger>
Fri, 2 Jul 2004 17:47:53 +0000 (17:47 +0000)
committerosdl.net!shemminger <osdl.net!shemminger>
Fri, 2 Jul 2004 17:47:53 +0000 (17:47 +0000)
(Logical change 1.47)

tc/Makefile

index 9e0952b998a95a5b619db0e38150a5c3ed73da4c..687ad5485fe1bcc9420cdeea7afd3a0ba4ecfec9 100644 (file)
@@ -17,16 +17,6 @@ TCMODULES += q_dsmark.o
 TCMODULES += q_gred.o
 TCMODULES += f_tcindex.o
 TCMODULES += q_ingress.o
-
-ifeq ($(TC_CONFIG_ATM),y)
-  TCMODULES += q_atm.o
-  LDLIBS += -latm
-endif
-
-ifeq ($(TC_CONFIG_NETEM),y)
-       TCMODULES += q_netem.o
-endif
-
 TCMODULES += q_csz.o
 TCMODULES += q_htb.o
 TCMODULES += q_hpfq.o
@@ -39,10 +29,22 @@ TCLIB += tc_red.o
 TCLIB += tc_cbq.o
 TCLIB += tc_estimator.o
 
+TCSO :=
+ifeq ($(TC_CONFIG_ATM),y)
+  TCSO += q_atm.so
+endif
+
+ifeq ($(TC_CONFIG_NETEM),y)
+  TCSO += q_netem.so
+endif
+
 LDLIBS += -L. -ltc -lm -ldl
 LDFLAGS += -Wl,-export-dynamic
 
-all: libtc.a tc
+%.so: %.c
+       $(CC) $(CFLAGS) -shared -fpic $< -o $@
+
+all: libtc.a tc $(TCSO)
 
 tc: $(TCOBJ) $(LIBNETLINK) $(LIBUTIL) $(TCLIB)
 
@@ -50,9 +52,14 @@ libtc.a: $(TCLIB)
        $(AR) rcs $@ $(TCLIB)
 
 install: all
+       mkdir -p $(DESTDIR)/usr/lib/tc
        install -m 0755 -s tc $(DESTDIR)$(SBINDIR)
-
+       for i in $(TCSO); do install -m 755 -s $$i $(DESTDIR)/usr/lib/tc; done
 
 clean:
        rm -f $(TCOBJ) $(TCLIB) libtc.a tc
 
+q_atm.so: q_atm.c
+       $(CC) $(CFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
+
+