--- ipvs-1.0.3/ipvs/Makefile Mon Mar 25 21:44:35 2002 +++ ipvs-1.0.3.new/ipvs/Makefile Sat Jun 8 12:10:19 2002 @@ -6,6 +6,21 @@ # uncomment the following line for DEBUG DEBUGFLAGS= -DCONFIG_IP_VS_DEBUG -g +KERNEL_VERSION = `uname -r` + +# As per the Linux Kernel's Makefile: +# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory +# relocations required by build roots. This is not defined in the +# makefile but the arguement can be passed to make if needed. + +MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv4/ipvs/ + + +SCHEDULERS = ip_vs_lc.o ip_vs_rr.o ip_vs_wlc.o ip_vs_wrr.o \ + ip_vs_lblc.o ip_vs_lblcr.o ip_vs_dh.o ip_vs_sh.o ip_vs_ftp.o +CORE = ip_vs.o +CORE_OBJ = ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ + ip_vs_timer.o ip_vs_app.o ip_vs_sync.o ip_vs_est.o CC=gcc CFLAGS= -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS \ @@ -13,17 +28,24 @@ -Wstrict-prototypes -I/usr/src/linux/include \ -include /usr/src/linux/include/linux/modversions.h -all: ip_vs.o ip_vs_lc.o ip_vs_rr.o ip_vs_wlc.o ip_vs_wrr.o \ - ip_vs_lblc.o ip_vs_lblcr.o ip_vs_dh.o ip_vs_sh.o ip_vs_ftp.o +all: $(CORE) $(SCHEDULERS) -ip_vs.o: ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ - ip_vs_timer.o ip_vs_app.o ip_vs_sync.o ip_vs_est.o +ip_vs.o: $(CORE_OBJ) $(LD) -r $^ -o $@ install: ip_vs.o -rmmod ip_vs insmod ip_vs.o lsmod + +modules_install: all + if [ ! -d "$(MODLIB)" ]; then mkdir -p "$(MODLIB)"; fi + install -m 600 -c $(CORE) $(SCHEDULERS) "$(MODLIB)" + depmod -a + +modules_uninstall: + (cd "$(MODLIB)"; rm -rf $(CORE) $(SCHEDULERS)) + rmdir "$(MODLIB)" clean: rm -f *.o *~ *.bak *.orig *.rej