Skip to content

Commit

Permalink
Basic support for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Jan 8, 2014
1 parent fd09975 commit 6a1c63b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CC = gcc
CFLAGS += -std=c99 -Wall -O3
LDFLAGS += -lm
MAKE = make

UNAME_S := $(shell uname -s)
UNAME_P := $(shell uname -p)
Expand All @@ -18,7 +19,9 @@ else
LIBJPEG = /usr/local/opt/jpeg-turbo/lib/libjpeg.a
else
# Windows
LIBJPEG = libjpeg.a
LIBJPEG = C:\libjpeg-turbo-gcc\lib\libjpeg.a
CFLAGS += -IC:\libjpeg-turbo-gcc\include
MAKE = mingw32-make
endif
endif

Expand All @@ -27,7 +30,7 @@ LIBIQA=src/iqa/build/release/libiqa.a
all: jpeg-recompress jpeg-compare jpeg-hash

$(LIBIQA):
cd src/iqa; RELEASE=1 make
cd src/iqa; RELEASE=1 $(MAKE)

jpeg-recompress: jpeg-recompress.c src/util.o src/edit.o src/commander.o $(LIBIQA)
$(CC) $(CFLAGS) -o $@ $^ $(LIBJPEG) $(LDFLAGS)
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ Mac users can install it via [Homebrew](http://brew.sh/):
brew install libjpeg-turbo
```

#### Windows
Windows users can install the official [libjpeg-turbo](http://sourceforge.net/projects/libjpeg-turbo/files/1.3.0/) release. You may also want to grab [IQA](http://sourceforge.net/projects/iqa/files/1.1.2%20Release/), setup Visual Studio, etc. Patches welcome.

The `Makefile` can work with MinGW, but IQA appears to not work when built with GCC on Windows.

### Compiling
The `Makefile` should work as-is on Ubuntu and Mac OS X. Other platforms may need to set the location of `libjpeg.a`.
The `Makefile` should work as-is on Ubuntu and Mac OS X. Other platforms may need to set the location of `libjpeg.a` or make other tweaks.

```bash
make
Expand Down

0 comments on commit 6a1c63b

Please sign in to comment.