Skip to content

Commit

Permalink
Merge pull request #5 from EvgeniDubov/windows_compilation
Browse files Browse the repository at this point in the history
on windows building dll instead of static library
  • Loading branch information
Craigacp authored Sep 24, 2017
2 parents bc3e294 + a44bb53 commit 68673db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ PREFIX = /usr/local
CFLAGS = -O3 -fPIC -std=c89 -pedantic -Wall -Werror
INCLUDES = -Iinclude
CC = gcc
AR = ar
AR_FLAGS = rcs
objects = build/ArrayOperations.o build/CalculateProbability.o \
build/Entropy.o build/MutualInformation.o \
build/RenyiEntropy.o build/RenyiMutualInformation.o \
Expand All @@ -24,8 +22,8 @@ objects = build/ArrayOperations.o build/CalculateProbability.o \
libMIToolbox.so : $(objects)
$(CC) $(CFLAGS) -shared -o libMIToolbox.so $(objects) -lm

libMIToolbox.a : $(objects)
$(AR) $(AR_FLAGS) libMIToolbox.a $(objects)
libMIToolbox.dll : $(objects)
$(CC) -shared -o libMIToolbox.dll $(objects) -lm

build/%.o: src/%.c
@mkdir -p build
Expand All @@ -42,7 +40,7 @@ x64:
$(MAKE) libMIToolbox.so "CFLAGS = -O3 -fPIC -m64"

x64_win:
$(MAKE) libMIToolbox.a "CFLAGS = -O3 -m64"
$(MAKE) libMIToolbox.dll "CFLAGS = -O3 -m64"

intel:
$(MAKE) libMIToolbox.so "CC = icc" "CFLAGS = -O2 -fPIC -xHost"
Expand All @@ -51,7 +49,7 @@ clean:
-rm -fr build
-rm -f matlab/*.o matlab/*.mex*
-rm -f libMIToolbox.so
-rm -f libMIToolbox.a
-rm -f libMIToolbox.dll

install: libMIToolbox.so
@echo "Installing libMIToolbox.so to $(PREFIX)/lib"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ Compilation instructions:
- Linux C shared library
- run `make x86` or `make x64` for 32-bit or 64-bit versions respectively.
- run `sudo make install` to install MIToolbox into `/usr/local/lib` and `/usr/local/include`
- Windows C static library
- Windows C dll
- install MinGW from https://sourceforge.net/projects/mingw-w64/
- add MinGW binaries folders to PATH, e.g. `mingw/bin`, `mingw/msys/bin`
- run the included makefile by > `make x64_win`
- run `make x64_win` to compile a 64-bit Windows dll.

Update History
- 08/02/2017 - v3.0.1 - Bug fix to ensure ANSI C compatibility.
Expand Down

0 comments on commit 68673db

Please sign in to comment.