From b792c1f27d58040f3a815da18183d329bd6bd84b Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 30 Sep 2021 10:05:39 +0000 Subject: tldk: swtich to use DPDK 20.11 LTS As in DPDK 20.11 'make' is not supported any more, switch to use pkg-conf approach. Note that RTE_SDK now should point to your DPDK package installation path. Signed-off-by: Konstantin Ananyev Change-Id: I4a3c394758e183a3ddcdb45a0562a81583daaab6 Signed-off-by: Konstantin Ananyev --- mk/tle.lib.mk | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'mk/tle.lib.mk') diff --git a/mk/tle.lib.mk b/mk/tle.lib.mk index 7455585..90bc989 100644 --- a/mk/tle.lib.mk +++ b/mk/tle.lib.mk @@ -11,26 +11,45 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTLIB_BUILD := y +LIB_SHARED = $(LIB_NAME).so +LIB_STATIC = $(LIB_NAME).a -# we must create the output dir first and recall the same Makefile -# from this directory -ifeq ($(NOT_FIRST_CALL),) +LDFLAGS += -Wl,--no-undefined $(LDFLAGS_SHARED) -NOT_FIRST_CALL = 1 -export NOT_FIRST_CALL +ifneq ($(LIB_DEPS),) + LDLIBS += -L$(RTE_OUTPUT)/lib + LDLIBS += $(patsubst %,-l%,$(LIB_DEPS)) + LDFLAGS += $(LDLIBS) +endif + +.PHONY: all clean static shared +all: shared static +shared: $(RTE_OUTPUT)/lib/$(LIB_SHARED) +static: $(RTE_OUTPUT)/lib/$(LIB_STATIC) + +OBJS := $(patsubst %.c,$(BDIR)/%.o,$(SRCS-y)) + +$(BDIR)/%.o: %.c Makefile $(HDRS) $(PC_FILE) + @mkdir -p $(BDIR) + $(Q)$(CC) $(CFLAGS) -c $< -o $@ -BDIR := $(RTE_OUTPUT)/build/$(CUR_SUBDIR) +HDRS := $(patsubst %.h,$(RTE_OUTPUT)/include/%.h,$(SYMLINK-y-include)) -all: - $(Q)mkdir -p $(BDIR) - $(Q)$(MAKE) -C $(BDIR) -f $(RTE_EXTMK) \ - S=$(RTE_SRCDIR) O=$(RTE_OUTPUT) SRCDIR=$(RTE_SRCDIR) +$(RTE_OUTPUT)/include/%.h: %.h Makefile $(PC_FILE) + $(Q)ln -s -f $(RTE_SRCDIR)/$< $@ + +clean: + $(Q)rm -f $(RTE_OUTPUT)/lib/$(LIB_SHARED) + $(Q)rm -f $(RTE_OUTPUT)/lib/$(LIB_STATIC) + $(Q)rm -f $(HDRS) + $(Q)rm -rf $(BDIR) + +$(RTE_OUTPUT)/lib/$(LIB_SHARED): $(HDRS) $(OBJS) Makefile $(PC_FILE) +ifneq ($(OBJS),) + $(Q)$(CC) $(OBJS) -o $@ -shared $(LDFLAGS) +endif -%:: - $(Q)mkdir -p $(BDIR) - $(Q)$(MAKE) -C $(BDIR) -f $(RTE_EXTMK) $@ \ - S=$(RTE_SRCDIR) O=$(RTE_OUTPUT) SRCDIR=$(RTE_SRCDIR) -else -include $(RTE_SDK)/mk/rte.lib.mk +$(RTE_OUTPUT)/lib/$(LIB_STATIC): $(HDRS) $(OBJS) Makefile $(PC_FILE) +ifneq ($(OBJS),) + $(Q)$(AR) -cr $@ $(OBJS) -o $@ endif -- cgit 1.2.3-korg