Skip to content

Commit

Permalink
some minor fixes, windows makefile improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmilk committed Feb 6, 2017
1 parent dad8d02 commit 7476328
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/lz4mt_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ size_t LZ4MT_compressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
2 changes: 1 addition & 1 deletion lib/lz4mt_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
2 changes: 1 addition & 1 deletion lib/lz5mt_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
2 changes: 1 addition & 1 deletion lib/lz5mt_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ size_t LZ5MT_decompressDCtx(LZ5MT_DCtx * ctx, LZ5MT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
2 changes: 1 addition & 1 deletion lib/zstdmt_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
2 changes: 1 addition & 1 deletion lib/zstdmt_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ size_t ZSTDMT_decompressDCtx(ZSTDMT_DCtx * ctx, ZSTDMT_RdWr_t * rdwr)
/* wait for all workers */
for (t = 0; t < ctx->threads; t++) {
cwork_t *w = &ctx->cwork[t];
void *p;
void *p = 0;
pthread_join(w->pthread, &p);
if (p)
retval_of_thread = p;
Expand Down
36 changes: 19 additions & 17 deletions windows/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

CROSS = i686-w64-mingw32-
#CROSS = x86_64-w64-mingw32-
CC = $(CROSS)gcc
STRIP = $(CROSS)strip
RANLIB = $(CROSS)ranlib
#CC = clang

CFLAGS = -W -pthread -Wall -pipe
CFLAGS = -fomit-frame-pointer
STRIP = $(CROSS)strip
SFLAGS = -R .note -R .comment

LDFLAGS = -lpthread
CFLAGS = -W -pthread -Wall -pipe -flto
CFLAGS += -fomit-frame-pointer

#CFLAGS += -DDEBUGME
#CFLAGS += -g
Expand All @@ -17,16 +19,16 @@ CFLAGS += -O3
#CFLAGS += -Wno-unused-variable
#CFLAGS += -Wno-unused-function

PRGS = lz4mt lz5mt zstdmt
PRGS = lz4mt.exe lz5mt.exe zstdmt.exe

all: loadsource $(PRGS)
again: clean $(PRGS)

ZSTDMTDIR = ../lib

LIBLZ4 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz4mt_common.c $(ZSTDMTDIR)/lz4mt_compress.c $(ZSTDMTDIR)/lz4mt_decompress.c
LIBLZ5 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz5mt_common.c $(ZSTDMTDIR)/lz5mt_compress.c $(ZSTDMTDIR)/lz5mt_decompress.c
LIBZSTD = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/zstdmt_common.c $(ZSTDMTDIR)/zstdmt_compress.c $(ZSTDMTDIR)/zstdmt_decompress.c
LIBLZ4 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz4mt_common.c $(ZSTDMTDIR)/lz4mt_compress.c $(ZSTDMTDIR)/lz4mt_decompress.c lz4mt.c
LIBLZ5 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz5mt_common.c $(ZSTDMTDIR)/lz5mt_compress.c $(ZSTDMTDIR)/lz5mt_decompress.c lz5mt.c
LIBZSTD = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/zstdmt_common.c $(ZSTDMTDIR)/zstdmt_compress.c $(ZSTDMTDIR)/zstdmt_decompress.c zstdmt.c

LZ4DIR = lz4/lib
LIBLZ4 += $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c
Expand Down Expand Up @@ -54,17 +56,17 @@ loadsource:
test -d lz5 || git clone https://github.com/inikep/lz5 -b v1.5 --depth=1 lz5
test -d zstd || git clone https://github.com/facebook/zstd -b v1.1.3 --depth=1 zstd

lz4mt: lz4mt.o
$(CC) $(CF_LZ4) $(LDFLAGS) -o $@ $(LIBLZ4) lz4mt.o
$(STRIP) $@
lz4mt.exe:
$(CC) $(CF_LZ4) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBLZ4)
$(STRIP) $(SFLAGS) $@

lz5mt: lz5mt.o
$(CC) $(CF_LZ5) $(LDFLAGS) -o $@ $(LIBLZ5) lz5mt.o
$(STRIP) $@
lz5mt.exe:
$(CC) $(CF_LZ5) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBLZ5)
$(STRIP) $(SFLAGS) $@

zstdmt: zstdmt.o
$(CC) $(CF_ZSTD) $(LDFLAGS) -o $@ $(LIBZSTD) zstdmt.o
$(STRIP) $@
zstdmt.exe:
$(CC) $(CF_ZSTD) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBZSTD)
$(STRIP) $(SFLAGS) $@

clean:
rm -f $(PRGS) *.o *.a

0 comments on commit 7476328

Please sign in to comment.