aboutsummaryrefslogtreecommitdiffstats
path: root/mk/tle.lib.mk
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2021-09-30 10:05:39 +0000
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2021-11-10 11:55:12 +0000
commitb792c1f27d58040f3a815da18183d329bd6bd84b (patch)
treedef302a01c2136211651fb90994806ae1ff0a32a /mk/tle.lib.mk
parentf71107b4dd6a4b8b1cd28d7339c924f1b013cfa4 (diff)
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 <konstantin.ananyev@intel.com> Change-Id: I4a3c394758e183a3ddcdb45a0562a81583daaab6 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'mk/tle.lib.mk')
-rw-r--r--mk/tle.lib.mk53
1 files changed, 36 insertions, 17 deletions
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