# Makefile for the MinGW suite for Windows
CC = g++  # or clang
CFLAGS = -O3 -g -msse2 -Wall
#LDFLAGS = -lpthread  # for UNIX or for Windows with pthread installed
LDFLAGS = -static  # for mingw
SOURCES = $(wildcard ../blosc/*.c)
EXECUTABLE = bench

# Support for internal LZ4
LZ4_DIR = ../internal-complibs/lz4-1.7.0
CFLAGS += -I$(LZ4_DIR)
SOURCES += $(wildcard $(LZ4_DIR)/*.c)

# Support for external LZ4
#LDFLAGS += -llz4

# Support for the msvc zlib:
ZLIB_ROOT=/libs/zlib128
LDFLAGS=-DHAVE_ZLIB -I$(ZLIB_ROOT)/include -lzdll -L$(ZLIB_ROOT)/lib

# Support for the mingw zlib:
#ZLIB_ROOT=/libs/libz-1.2.8
#LDFLAGS=-DHAVE_ZLIB -I$(ZLIB_ROOT)/include -lz -L$(ZLIB_ROOT)/lib

# Support for internal Zlib
#ZLIB_DIR = ../internal-complibs/zlib-1.2.8
#CFLAGS += -DHAVE_ZLIB -I$(ZLIB_DIR)
#SOURCES += $(wildcard $(ZLIB_DIR)/*.c)


all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(SOURCES)
	$(CC) $(CFLAGS) bench.c $(SOURCES) -o $@ $(LDFLAGS)

clean:
	rm -rf $(EXECUTABLE)
