dynamic linking for mod capwap

FossilOrigin-Name: e31f9c799d5c0bf4fb449f0e8a648353aea272a394ef2cf0c2e0f83a8e973026
This commit is contained in:
7u83@mail.ru 2018-02-25 23:50:05 +00:00
parent dbd934e9fe
commit a71b86b125
3 changed files with 30 additions and 17 deletions

View File

@ -349,7 +349,7 @@ $(SNAME) : $(OBJS) $(MODOBJS)
$(DNAME) : $(OBJS) $(MODOBJS) $(DNAME) : $(OBJS) $(MODOBJS)
@mkdir -p $(LIBARCHDIR) @mkdir -p $(LIBARCHDIR)
@echo " AR $(DNAME)" @echo " $(CC) $(DNAME)"
@$(CC) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(MODOBJS) $(LIBS) @$(CC) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(MODOBJS) $(LIBS)

View File

@ -1,32 +1,38 @@
include ../../Macros.mak include ../../Macros.mak
include ../../Config.mak include ../../Config.mak
include ../../Config.local.mak
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
CFLAGS = -fPIC -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 $(COMPDEFS) -DWITH_RMAC_SUPPORT -I ../../ -I../ -I../../include CFLAGS = -fPIC -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 $(COMPDEFS) -DWITH_RMAC_SUPPORT -I ../../ -I../ -I../../include
LIBDIR=../../lib/$(ARCH)
SRCS = $(OBJS:.o=.c) SRCS = $(OBJS:.o=.c)
$(ARCH)/%.o:%.c all: $(SNAME) $(DNAME)
@mkdir -p $(ARCH)
@echo " CC "$< $(OBJDIR)/%.o:%.c
@mkdir -p $(OBJDIR)
@echo " $(CC) "$<
@$(CC) -c $(CFLAGS) $< -o $@ @$(CC) -c $(CFLAGS) $< -o $@
$(LIBDIR)/$(NAME) : $(OBJS) $(MODOBJS) $(SNAME) : $(OBJS) $(MODOBJS)
@mkdir -p $(LIBDIR) @mkdir -p $(LIBDIR)
@echo " AR $(LIBDIR)/$(NAME)" @echo " $(AR) $(SNAME)"
@$(AR) rcs $(LIBDIR)/$(NAME) $(OBJS) $(MODOBJS) @$(AR) rcs $(SNAME) $(OBJS) $(MODOBJS)
$(CC) -L$(LIBDIR) $(OBJS) $(MODOBJS) $(SLIBS) -v -shared -o ../../../lib/actube/capwap.so
$(DNAME) : $(OBJS) $(MODOBJS)
@mkdir -p $(LIBDIR)
@echo " $(CC) $(DNAME)"
@$(CC) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(MODOBJS) $(LIBS)
# $(CC) -L$(LIBDIR) $(OBJS) $(MODOBJS) $(SLIBS) -v -shared -o ../../../lib/actube/capwap.so
all: $(LIBDIR)/$(NAME)
clean: clean:
rm -rf $(ARCH) rm -rf $(OBJDIR)
rm -f $(LIBDIR)/$(NAME) rm -f $(SNAME)

View File

@ -1,3 +1,8 @@
include ../../Macros.mak
include ../../Config.mak
include ../../Config.local.mak
OBJS=\ OBJS=\
mod_capwap_ac.o \ mod_capwap_ac.o \
@ -12,11 +17,13 @@ OBJS=\
capwap_in_wtp_descriptor.o \ capwap_in_wtp_descriptor.o \
capwap_out_ac_ip_list.o \ capwap_out_ac_ip_list.o \
capwap_in_session_id.o \ capwap_in_session_id.o \
# capwap_in
NAME=libcapwap.a LIBDIR := ../../../lib/$(ARCH)
SLIBS=-lcw OBJDIR := ../../../obj/mod_capwap/$(ARCH)
SNAME := $(LIBDIR)/libcapwap.a
DNAME := $(LIBDIR)/capwap.so
SLIBS := -lcw
include ../Mod.mak include ../Mod.mak