From d3ea2e81938ae99e48ee5ad928d08e50f1710757 Mon Sep 17 00:00:00 2001 From: "osdl.net!shemminger" Date: Fri, 2 Jul 2004 17:47:53 +0000 Subject: [PATCH] Build atm and netem as shared libraries (Logical change 1.47) --- tc/Makefile | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tc/Makefile b/tc/Makefile index 9e0952b9..687ad548 100644 --- a/tc/Makefile +++ b/tc/Makefile @@ -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 + +