1TOPDIR=.. 2 3ifeq ($(FF_PATH),) 4 FF_PATH=${TOPDIR} 5endif 6 7ifneq ($(shell pkg-config --exists libdpdk && echo 0),0) 8$(error "No installation of DPDK found, maybe you should export environment variable `PKG_CONFIG_PATH`") 9endif 10 11PKGCONF ?= pkg-config 12 13CFLAGS += -O -gdwarf-2 $(shell $(PKGCONF) --cflags libdpdk) 14 15LIBS+= $(shell $(PKGCONF) --static --libs libdpdk) 16LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive 17LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread -lnuma 18 19TARGET="helloworld" 20all: 21 cc ${CFLAGS} -o ${TARGET} main.c ${LIBS} 22 cc ${CFLAGS} -o ${TARGET}_epoll main_epoll.c ${LIBS} 23 24.PHONY: clean 25clean: 26 rm -f *.o ${TARGET} ${TARGET}_epoll 27