xref: /f-stack/example/Makefile (revision eec4e172)
17abd0fb2SlogwangTOPDIR=..
27abd0fb2Slogwang
37abd0fb2Slogwangifeq ($(FF_PATH),)
47abd0fb2Slogwang	FF_PATH=${TOPDIR}
57abd0fb2Slogwangendif
67abd0fb2Slogwang
78d76b62eSfengbojiangifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
8*eec4e172SAayush Atharva$(error "No installation of DPDK found, maybe you should export environment variable `PKG_CONFIG_PATH`")
97abd0fb2Slogwangendif
107abd0fb2Slogwang
118d76b62eSfengbojiangPKGCONF ?= pkg-config
128d76b62eSfengbojiang
138d76b62eSfengbojiangCFLAGS += -O -gdwarf-2 $(shell $(PKGCONF) --cflags libdpdk)
148d76b62eSfengbojiang
158d76b62eSfengbojiangLIBS+= $(shell $(PKGCONF) --static --libs libdpdk)
162bfe3f2eSlogwangLIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
17449c1f68Sjfb8856606LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread -lnuma
1887454041Slogwang
19a9643ea8SlogwangTARGET="helloworld"
20a9643ea8Slogwangall:
218d76b62eSfengbojiang	cc ${CFLAGS} -o ${TARGET} main.c ${LIBS}
228d76b62eSfengbojiang	cc ${CFLAGS} -o ${TARGET}_epoll main_epoll.c ${LIBS}
23a9643ea8Slogwang
24a9643ea8Slogwang.PHONY: clean
25a9643ea8Slogwangclean:
268cf1d457Slogwang	rm -f *.o ${TARGET} ${TARGET}_epoll
27