From 6a1c63bcf829169daedb73a56e9bfcc7a3fa5113 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 7 Jan 2014 23:37:59 -0800 Subject: [PATCH] Basic support for Windows --- Makefile | 7 +++++-- README.md | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 897779e..5b0e929 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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 @@ -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) diff --git a/README.md b/README.md index 36514f2..b2e2f1d 100644 --- a/README.md +++ b/README.md @@ -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