summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/Makefile22
-rwxr-xr-xrbutil/bootloaders.cpp4
-rwxr-xr-xrbutil/bootloaders.h5
-rwxr-xr-xrbutil/irivertools.cpp1
-rwxr-xr-xrbutil/irivertools.h1
-rw-r--r--rbutil/rbutil.cpp1
6 files changed, 25 insertions, 9 deletions
diff --git a/rbutil/Makefile b/rbutil/Makefile
index 824bd64155..9321ed8ed8 100644
--- a/rbutil/Makefile
+++ b/rbutil/Makefile
@@ -9,11 +9,25 @@
# Unix-style Makefile for rbutil
+#detect cygwin
+ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
+ __CYGWIN__ := 1
+endif
+
CXX=$(shell $(PREFIX)wx-config --version=2.8 --cxx)
INC = `$(PREFIX)wx-config --version=2.8 --cxxflags`
LIBS = `$(PREFIX)wx-config --version=2.8 --libs`
-CFLAGS = -Wall -Wundef -DRBUTIL -D_LARGEFILE64_SOURCE
-OBJS=rbutil.o rbutilApp.o rbutilFrm.o rbutilCtrls.o install_dialogs.o bootloaders.o installlog.o ipodpatcher/ipodpatcher.o ipodpatcher/ipodio-posix.o sansapatcher/sansapatcher.o sansapatcher/sansaio-posix.o irivertools.o md5sum.o autodetection.o
+CFLAGS= -Wall -Wundef -DRBUTIL -D_LARGEFILE64_SOURCE
+OBJS=rbutil.o rbutilApp.o rbutilFrm.o rbutilCtrls.o install_dialogs.o bootloaders.o installlog.o ipodpatcher/ipodpatcher.o sansapatcher/sansapatcher.o irivertools.o md5sum.o autodetection.o
+
+ifdef __CYGWIN__
+OBJS+=ipodpatcher/ipodio-win32.o sansapatcher/sansaio-win32.o
+CFLAGS+= -mno-cygwin -mwindows
+else
+OBJS+=ipodpatcher/ipodio-posix.o sansapatcher/sansaio-posix.o
+endif
+
+
EXTRAOBJS = $(wildcard icons/*.o)
SILENT = @
@@ -34,7 +48,7 @@ endif
.PHONY: all
all: icons rbutil$(EXT)
-
+
.cpp.o :
$(SILENT) echo CXX $<
$(SILENT) $(CXX) $(CFLAGS) $(INC) -c -o $@ $<
@@ -46,7 +60,7 @@ all: icons rbutil$(EXT)
rbutil-rc.o: rbutil-rc.rc
$(WINDRES) -O coff -F pe-i386 -o $@ $<
-rbutil$(EXT): $(OBJS)
+rbutil$(EXT): $(OBJS)
$(SILENT) echo CXX $<
$(SILENT) $(CXX) -o $@ $(OBJS) $(EXTRAOBJS) $(LIBS)
diff --git a/rbutil/bootloaders.cpp b/rbutil/bootloaders.cpp
index 56f936e4ff..4ac4828307 100755
--- a/rbutil/bootloaders.cpp
+++ b/rbutil/bootloaders.cpp
@@ -19,11 +19,7 @@
****************************************************************************/
#include "bootloaders.h"
-#include "irivertools.h"
-#include "md5sum.h"
-#include "rbutil.h"
-#include "installlog.h"
int verbose =0;
diff --git a/rbutil/bootloaders.h b/rbutil/bootloaders.h
index ba751bd715..d5bda126cc 100755
--- a/rbutil/bootloaders.h
+++ b/rbutil/bootloaders.h
@@ -24,6 +24,11 @@
#define BOOTLOADERS_H_INCLUDED
#include <wx/string.h>
+#include "irivertools.h"
+#include "md5sum.h"
+
+#include "rbutil.h"
+#include "installlog.h"
extern "C" {
// Ipodpatcher
diff --git a/rbutil/irivertools.cpp b/rbutil/irivertools.cpp
index 1e6341923d..9b7cd5a4f3 100755
--- a/rbutil/irivertools.cpp
+++ b/rbutil/irivertools.cpp
@@ -19,7 +19,6 @@
****************************************************************************/
#include "irivertools.h"
-#include "md5sum.h"
const unsigned char munge[] = {
diff --git a/rbutil/irivertools.h b/rbutil/irivertools.h
index 9718f92d00..d646cf1d6c 100755
--- a/rbutil/irivertools.h
+++ b/rbutil/irivertools.h
@@ -24,6 +24,7 @@
#include "rbutil.h"
#include "installlog.h"
+#include "md5sum.h"
#define ESTF_SIZE 32
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp
index a36d1a0b94..1528ccb2c5 100644
--- a/rbutil/rbutil.cpp
+++ b/rbutil/rbutil.cpp
@@ -349,6 +349,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
{
buf = wxT("Can't open file ") + in_str + wxT(" for writing");
delete out;
+ delete progress;
return 100;
} else if (isInstall)
{