build: minor cleanups to the makefile
Try to isolate DPDK a tad more to the iokerneld binary.
-DPDK = dpdk
-INC = -I./inc -I$(DPDK)/build/include
+DPDK_PATH = dpdk
+INC = -I./inc -I$(DPDK_PATH)/build/include
CFLAGS = -g -Wall -std=gnu11 -D_GNU_SOURCE $(INC) -mssse3
LDFLAGS = -T base/base.ld
-LDLIBS = -L$(DPDK)/build/lib -lnuma -ldl
LD = gcc
CC = gcc
AR = ar
@@ -48,7 +47,7 @@ test_obj = $(test_src:.c=.o)
test_targets = $(basename $(test_src))
# dpdk libs
-DPDK_LIBS=
+DPDK_LIBS= -L$(DPDK_PATH)/build/lib
DPDK_LIBS += -Wl,-whole-archive -lrte_pmd_e1000 -Wl,-no-whole-archive
DPDK_LIBS += -Wl,-whole-archive -lrte_pmd_ixgbe -Wl,-no-whole-archive
DPDK_LIBS += -Wl,-whole-archive -lrte_mempool_ring -Wl,-no-whole-archive
@@ -78,7 +77,8 @@ libruntime.a: $(runtime_obj)
$(AR) rcs $@ $^
iokerneld: $(iokernel_obj) libbase.a libnet.a base/base.ld
- $(LD) $(LDFLAGS) -o $@ $(iokernel_obj) libbase.a libnet.a $(DPDK_LIBS) $(LDLIBS) -lpthread
+ $(LD) $(LDFLAGS) -o $@ $(iokernel_obj) libbase.a libnet.a $(DPDK_LIBS) \
+ -lpthread -lnuma -ldl
$(test_targets): $(test_obj) libbase.a libruntime.a base/base.ld
$(LD) $(LDFLAGS) -o $@ $@.o libbase.a libruntime.a -lpthread
@@ -110,4 +110,5 @@ sparse: $(src)
.PHONY: clean
clean:
- rm -f $(obj) $(dep) libbase.a libdune.a libnet.a libruntime.a iokerneld $(test_targets)
+ rm -f $(obj) $(dep) libbase.a libdune.a libnet.a libruntime.a \
+ iokerneld $(test_targets)
