(hopefully) fix some broken download stuff I introduced yesterday.
[Rockbox.git] / rbutil / Makefile
blobfe3b5b74a1d8db509c13906ba72d5c4706242324
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 # Unix-style Makefile for rbutil
12 #detect cygwin
13 ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
14 __CYGWIN__ := 1
15 endif
17 CXX=$(shell $(PREFIX)wx-config --version=2.8 --cxx)
18 INC = `$(PREFIX)wx-config --version=2.8 --cxxflags`
19 LIBS = `$(PREFIX)wx-config --version=2.8 --libs`
20 CFLAGS= -Wall -Wundef -DRBUTIL -D_LARGEFILE64_SOURCE
21 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 talkfile.o
23 ifdef __CYGWIN__
24 OBJS+=ipodpatcher/ipodio-win32.o sansapatcher/sansaio-win32.o
25 CFLAGS+= -mno-cygwin -mwindows
26 else
27 OBJS+=ipodpatcher/ipodio-posix.o sansapatcher/sansaio-posix.o
28 endif
31 EXTRAOBJS = $(wildcard icons/*.o)
33 SILENT = @
35 # Install with / as root by default
36 ifndef DESTDIR
37 DESTDIR=""
38 endif
40 # type "make WIN=1" for a Windows build using the Debian mingw cross-compiler
41 ifdef WIN
42 CROSS=i586-mingw32msvc-
43 WINDRES=i586-mingw32msvc-windres
44 EXT=.exe
45 PREFIX=/usr/i586-mingw32msvc/bin/
46 OBJS+=rbutil-rc.o
47 endif
49 .PHONY: all
50 all: icons rbutil$(EXT)
52 .cpp.o :
53 $(SILENT) echo CXX $<
54 $(SILENT) $(CXX) $(CFLAGS) $(INC) -c -o $@ $<
56 .c.o :
57 $(SILENT) echo CC $<
58 $(SILENT) $(CC) $(CFLAGS) $(INC) -c -o $@ $<
60 rbutil-rc.o: rbutil-rc.rc
61 $(WINDRES) -O coff -F pe-i386 -o $@ $<
63 rbutil$(EXT): $(OBJS)
64 $(SILENT) echo CXX $<
65 $(SILENT) $(CXX) -o $@ $(OBJS) $(EXTRAOBJS) $(LIBS)
67 .PHONY: icons
68 icons:
69 $(SILENT) $(MAKE) -C icons
71 .PHONY: clean
72 clean:
73 rm -f rbutil rbutil.exe $(OBJS) *~
74 make -C icons clean
76 .PHONY: install
77 install:
78 install -D rbutil$(EXT) $(DESTDIR)/usr/bin/rbutil$(EXT)