From f71340ce1d8daa9f13cf4f1ecf2a21f23e3790ff Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Tue, 15 Nov 2016 11:06:16 +0100 Subject: [PATCH] DLL dependencies moved to lib/dll/ --- lib/Makefile | 6 +++--- lib/README.md | 6 +++--- lib/{ => dll}/liblz4.def | 0 tests/Makefile | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename lib/{ => dll}/liblz4.def (100%) diff --git a/lib/Makefile b/lib/Makefile index d098846..4c9b929 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -86,8 +86,8 @@ endif liblz4: *.c @echo compiling dynamic library $(LIBVER) ifneq (,$(filter Windows%,$(OS))) - @$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o $@.dll - dlltool -D liblz4.dll -d liblz4.def -l liblz4.dll.a + @$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll\$@.dll + dlltool -D dll\liblz4.dll -d dll\liblz4.def -l dll\liblz4.lib else @$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) @echo creating versioned links @@ -96,7 +96,7 @@ else endif clean: - @$(RM) -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc + @$(RM) -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc dll/liblz4.dll dll/liblz4.lib @echo Cleaning library completed diff --git a/lib/README.md b/lib/README.md index 19f429a..430be1f 100644 --- a/lib/README.md +++ b/lib/README.md @@ -41,12 +41,12 @@ It must be used with static linking ***only***. #### Using MinGW+MSYS to create DLL DLL can be created using MinGW+MSYS with the `make liblz4` command. -This command creates `liblz4.dll` and the import library `liblz4.dll.a`. +This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`. To compile a project the import library has to be added to linking options. It means that if a project that uses LZ4 consists of a single `test-dll.c` -file it should be compiled with "liblz4.dll.a". For example: +file it should be compiled with "liblz4.lib". For example: ``` - gcc $(CFLAGS) test-dll.c -o test-dll liblz4.dll.a + gcc $(CFLAGS) test-dll.c -o test-dll liblz4.lib ``` diff --git a/lib/liblz4.def b/lib/dll/liblz4.def similarity index 100% rename from lib/liblz4.def rename to lib/dll/liblz4.def diff --git a/tests/Makefile b/tests/Makefile index a11cf9b..2132f85 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -94,7 +94,7 @@ fullbench-lib: fullbench.c $(LZ4DIR)/xxhash.c fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c $(MAKE) -C $(LZ4DIR) liblz4 - $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/liblz4.dll.a + $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.lib fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c $(CC) $(FLAGS) $^ -o $@$(EXT)