2006-12-12 10:26:30 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2006-12-14 03:55:15 +00:00
|
|
|
# Unix-style Makefile for rbutil
|
2006-12-12 10:26:30 +00:00
|
|
|
|
2007-07-14 16:54:54 +00:00
|
|
|
#detect cygwin
|
|
|
|
ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
|
|
|
|
__CYGWIN__ := 1
|
|
|
|
endif
|
|
|
|
|
2007-05-16 19:12:22 +00:00
|
|
|
CXX=$(shell $(PREFIX)wx-config --version=2.8 --cxx)
|
2007-06-23 15:41:30 +00:00
|
|
|
INC = `$(PREFIX)wx-config --version=2.8 --cxxflags`
|
|
|
|
LIBS = `$(PREFIX)wx-config --version=2.8 --libs`
|
2007-07-14 16:54:54 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2007-06-23 15:41:30 +00:00
|
|
|
EXTRAOBJS = $(wildcard icons/*.o)
|
|
|
|
|
|
|
|
SILENT = @
|
2006-12-12 10:44:59 +00:00
|
|
|
|
2007-02-17 02:24:37 +00:00
|
|
|
# Install into /usr/local by default
|
|
|
|
ifndef DESTDIR
|
|
|
|
DESTDIR=/usr/local
|
|
|
|
endif
|
2006-12-12 10:44:59 +00:00
|
|
|
|
2006-12-12 10:26:30 +00:00
|
|
|
# type "make WIN=1" for a Windows build using the Debian mingw cross-compiler
|
|
|
|
ifdef WIN
|
|
|
|
CROSS=i586-mingw32msvc-
|
|
|
|
WINDRES=i586-mingw32msvc-windres
|
|
|
|
EXT=.exe
|
|
|
|
PREFIX=/usr/i586-mingw32msvc/bin/
|
2006-12-12 10:44:59 +00:00
|
|
|
OBJS+=rbutil-rc.o
|
2006-12-12 10:26:30 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all
|
2007-06-23 15:41:30 +00:00
|
|
|
all: icons rbutil$(EXT)
|
2007-07-14 16:54:54 +00:00
|
|
|
|
2006-12-12 10:26:30 +00:00
|
|
|
.cpp.o :
|
2007-06-23 15:41:30 +00:00
|
|
|
$(SILENT) echo CXX $<
|
|
|
|
$(SILENT) $(CXX) $(CFLAGS) $(INC) -c -o $@ $<
|
2007-02-17 02:24:37 +00:00
|
|
|
|
|
|
|
.c.o :
|
2007-06-23 15:41:30 +00:00
|
|
|
$(SILENT) echo CC $<
|
|
|
|
$(SILENT) $(CC) $(CFLAGS) $(INC) -c -o $@ $<
|
2006-12-12 10:26:30 +00:00
|
|
|
|
|
|
|
rbutil-rc.o: rbutil-rc.rc
|
2007-06-23 15:41:30 +00:00
|
|
|
$(WINDRES) -O coff -F pe-i386 -o $@ $<
|
|
|
|
|
2007-07-14 16:54:54 +00:00
|
|
|
rbutil$(EXT): $(OBJS)
|
2007-06-23 15:41:30 +00:00
|
|
|
$(SILENT) echo CXX $<
|
|
|
|
$(SILENT) $(CXX) -o $@ $(OBJS) $(EXTRAOBJS) $(LIBS)
|
2006-12-12 10:26:30 +00:00
|
|
|
|
2007-06-23 15:41:30 +00:00
|
|
|
.PHONY: icons
|
|
|
|
icons:
|
|
|
|
$(SILENT) $(MAKE) -C icons
|
2006-12-12 10:26:30 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f rbutil rbutil.exe $(OBJS) *~
|
2007-06-23 15:41:30 +00:00
|
|
|
make -C icons clean
|
2007-02-17 02:24:37 +00:00
|
|
|
|
|
|
|
.PHONY: install
|
2007-06-27 15:06:23 +00:00
|
|
|
install:
|
2007-02-17 02:24:37 +00:00
|
|
|
install -D rbutil$(EXT) $(DESTDIR)/bin/rbutil$(EXT)
|