DLL dependencies moved to lib/dll/

This commit is contained in:
Przemyslaw Skibinski 2016-11-15 11:06:16 +01:00
parent f3f59bef4f
commit f71340ce1d
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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
```

View File

@ -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)