X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fhelloworld%2FMakefile;fp=examples%2Fhelloworld%2FMakefile;h=19b33850bff5060520b315a7563fff181375e8ff;hb=22119c4591a008abe5de8e395a97fcc09c8dc14a;hp=1e58e4112424150cde3bb156870d40169061a8be;hpb=0eba4ade654bae51877474fb64ab5e79df0f3442;p=dpdk.git diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile index 1e58e41124..19b33850bf 100644 --- a/examples/helloworld/Makefile +++ b/examples/helloworld/Makefile @@ -7,6 +7,27 @@ APP = helloworld # all source are stored in SRCS-y SRCS-y := main.c +# Build using pkg-config variables if possible +$(shell pkg-config --exists libdpdk) +ifeq ($(.SHELLSTATUS),0) + +PC_FILE := $(shell pkg-config --path libdpdk) +CFLAGS += $(shell pkg-config --cflags libdpdk) +LDFLAGS += $(shell pkg-config --libs libdpdk) + +build/$(APP): $(SRCS-y) Makefile $(PC_FILE) | build + $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) + +build: + @mkdir -p $@ + +.PHONY: clean +clean: + rm -f build/$(APP) + rmdir --ignore-fail-on-non-empty build + +else + ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif @@ -20,3 +41,5 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) include $(RTE_SDK)/mk/rte.extapp.mk + +endif