Comments
Patch
===================================================================
@@ -19,7 +19,11 @@
PROGRAM = flashrom
+ifeq ($(OS), Windows_NT)
+CC = gcc
+else
CC ?= gcc
+endif
STRIP = strip
INSTALL = install
DIFF = diff
@@ -41,7 +45,11 @@
LDFLAGS += -L/usr/local/lib
endif
+ifeq ($(OS), Windows_NT)
+LIBS += -L. -ldirectio
+else
LIBS += -lpci -lz
+endif
OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \
sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o pm29f002.o \
@@ -68,8 +76,10 @@
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) $(FEATURE_LIBS)
FEATURE_CFLAGS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
-# Always enable serprog for now. Needs to be disabled on Windows.
+
+ifneq ($(OS), Windows_NT)
FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
+endif
FEATURE_LIBS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
@@ -102,6 +112,7 @@
rm -f .test.c .test; exit 1)
@rm -f .test.c .test
+ifneq ($(OS), Windows_NT)
pciutils: compiler
@printf "Checking for pciutils and zlib... "
@$(shell ( echo "#include <pci/pci.h>"; \
@@ -114,6 +125,7 @@
echo "See README for more information."; echo; \
rm -f .test.c .test; exit 1)
@rm -f .test.c .test
+endif
.features: features