From 838fa5bb37d27ec269647bfc56c0c655f164572a Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sat, 18 Jun 2005 14:43:32 +0000 Subject: ebtables library directory --- Makefile | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 025ce8a..ac3e9fa 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,17 @@ PROGNAME:=ebtables PROGVERSION:=2.0.7 -PROGDATE:=January\ 2004 +PROGDATE:=June\ 2005 # default paths LIBDIR:=/usr/lib MANDIR:=/usr/local/man -BINDIR:=/usr/sbin +BINDIR:=/usr/local/sbin ETCDIR:=/etc DESTDIR:= # include DESTDIR param -override LIBDIR:=$(DESTDIR)$(LIBDIR) +override LIBDIR:=$(DESTDIR)$(LIBDIR)/$(PROGNAME) override MANDIR:=$(DESTDIR)$(MANDIR) override BINDIR:=$(DESTDIR)$(BINDIR) override ETCDIR:=$(DESTDIR)$(ETCDIR) @@ -29,7 +29,7 @@ endif include extensions/Makefile OBJECTS2:=getethertype.o communication.o libebtc.o \ -useful_functions.o +useful_functions.o ebtables.o OBJECTS:=$(OBJECTS2) ebtables.o $(EXT_OBJS) $(EXT_LIBS) @@ -61,6 +61,10 @@ PROGSPECSD:=-DPROGVERSION=\"$(PROGVERSION)\" \ -DEBTD_PIPE=\"$(PIPE)\" \ -DEBTD_PIPE_DIR=\"$(PIPE_DIR)\" +# Uncomment for debugging (slower) +#PROGSPECS+=-DEBT_DEBUG +#PROGSPECSD+=-DEBT_DEBUG + all: ebtables daemon communication.o: communication.c include/ebtables_u.h @@ -78,24 +82,26 @@ getethertype.o: getethertype.c include/ethernetdb.h ebtables.o: ebtables.c include/ebtables_u.h $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) -ebtables-standalone.o: ebtables-standalone.c ebtables.c include/ebtables_u.h - $(CC) $(CFLAGS) $(PROGSPECS) -c $< ebtables.c -o $@ -I$(KERNEL_INCLUDES) +ebtables-standalone.o: ebtables-standalone.c include/ebtables_u.h + $(CC) $(CFLAGS) $(PROGSPECS) -c $< -o $@ -I$(KERNEL_INCLUDES) -ebtables: $(OBJECTS) ebtables-standalone.o +.PHONY: libebtc +libebtc: $(OBJECTS2) $(LD) -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) - $(CC) $(CFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L/root/ \ - -L. -Lextensions/ -lebtc $(EXT_LIBSI) + +ebtables: $(OBJECTS) ebtables-standalone.o libebtc + $(CC) $(CFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ + -Wl,-rpath,$(LIBDIR) ebtablesu: ebtablesu.c $(CC) $(CFLAGS) $(PROGSPECSD) $< -o $@ -ebtablesd.o: ebtablesd.c ebtables.c include/ebtables_u.h - $(CC) $(CFLAGS) $(PROGSPECSD) -c $< ebtables.c -o $@ -I$(KERNEL_INCLUDES) +ebtablesd.o: ebtablesd.c include/ebtables_u.h + $(CC) $(CFLAGS) $(PROGSPECSD) -c $< -o $@ -I$(KERNEL_INCLUDES) -ebtablesd: $(OBJECTS) ebtablesd.o - $(LD) -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) - $(CC) $(CFLAGS) -o $@ ebtablesd.o -I$(KERNEL_INCLUDES) -L/root/ \ - -L. -Lextensions/ -lebtc $(EXT_LIBSI) +ebtablesd: $(OBJECTS) ebtablesd.o libebtc + $(CC) $(CFLAGS) -o $@ ebtablesd.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ + -Wl,-rpath,$(LIBDIR) .PHONY: daemon daemon: ebtablesd ebtablesu -- cgit v1.2.3