--- a/test/Makefile +++ b/test/Makefile @@ -34,42 +34,27 @@ # ####################################################################### LIB = ../src -LDFLAGS = $(LIB)/libqatseqprod.a -I$(LIB) +LDFLAGS = -L$(LIB) -I$(LIB) ifneq ($(ICP_ROOT), ) LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build else - LDFLAGS += -lqat -lusdm -lnuma -endif - -ifdef ZSTDLIB -CFLAGS += -I$(ZSTDLIB) -LDFLAGS += $(ZSTDLIB)/libzstd.a -else -ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1| xargs dirname) -LDFLAGS += $(ZSTDLIB)/libzstd.a + LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm endif default: test benchmark all: test benchmark -check_zstdlib: - @echo checking zstd static libaray '$(ZSTDLIB)/libzstd.a' - @if [ ! -e $(ZSTDLIB)/libzstd.a ]; then \ - echo libzstd.a is not found, please install libzstd or specify the path manually; \ - exit 1; \ - fi - -test: test.c check_zstdlib +test: test.c $(Q)$(MAKE) -C $(LIB) $(CC) $< $(CFLAGS) $(LDFLAGS) -o $@ -benchmark: benchmark.c check_zstdlib +benchmark: benchmark.c $(Q)$(MAKE) -C $(LIB) $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ -lpthread clean: $(Q)$(MAKE) -C $(LIB) $@ $(RM) test benchmark -.PHONY: clean check_zstdlib +.PHONY: clean --- a/test/test.c +++ b/test/test.c @@ -44,9 +44,6 @@ #include "qatseqprod.h" -#ifndef ZSTD_STATIC_LINKING_ONLY -#define ZSTD_STATIC_LINKING_ONLY -#endif #include "zstd.h" #include "zstd_errors.h"