From 64182a3092399c5cfd1ad6b2ad87f9f074354292 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Wed, 21 Jan 2004 20:39:54 +0000 Subject: add shared libraries --- Makefile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3c3229f..dc86a8f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ # ebtables Makefile PROGNAME:=ebtables -PROGVERSION:=2.0.5 -PROGDATE:=July\ 2003 +PROGVERSION:=2.0.7 +PROGDATE:=January\ 2004 +LIBDIR?=/usr/lib/ MANDIR?=$(DESTDIR)/usr/local/man CFLAGS:=-Wall -Wunused CC:=gcc +LD:=ld ifeq ($(shell uname -m),sparc64) CFLAGS+=-DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32 @@ -14,8 +16,10 @@ endif include extensions/Makefile -OBJECTS:=getethertype.o ebtables.o communication.o libebtc.o \ -useful_functions.o $(EXT_OBJS) +OBJECTS2:=getethertype.o communication.o libebtc.o \ +useful_functions.o + +OBJECTS:=$(OBJECTS2) ebtables.o $(EXT_OBJS) $(EXT_LIBS) KERNEL_INCLUDES?=include/ @@ -49,7 +53,10 @@ ebtables.o: ebtables.c include/ebtables_u.h $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) ebtables: $(OBJECTS) - $(CC) $(CFLAGS) -o $@ $^ -I$(KERNEL_INCLUDES) + ld -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) + $(CC) $(CFLAGS) -o $@ ebtables.o -I$(KERNEL_INCLUDES) -L/root/ \ + -L. -Lextensions/ -lebtc $(EXT_LIBSI) + $(MANDIR)/man8/ebtables.8: ebtables.8 mkdir -p $(@D) @@ -65,12 +72,14 @@ exec: ebtables .PHONY: install install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec + install -m 0755 extensions/*.so $(LIBDIR) + install -m 0755 *.so $(LIBDIR) .PHONY: clean clean: rm -f ebtables - rm -f *.o *.c~ - rm -f extensions/*.o extensions/*.c~ + rm -f *.o *.c~ *.so + rm -f extensions/*.o extensions/*.c~ extensions/*.so DIR:=$(PROGNAME)-v$(PROGVERSION) # This is used to make a new userspace release -- cgit v1.2.3