2009-10-28 21:11:43 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
2009-10-29 21:31:50 +00:00
|
|
|
|
|
|
|
# We use the Telechips code available in the Rockbox tools/ directory
|
2009-10-28 21:11:43 +00:00
|
|
|
TOOLSDIR=../../tools
|
|
|
|
CFLAGS := -O -g -W -Wall -Wshadow -pedantic -I$(TOOLSDIR)
|
|
|
|
|
2009-10-29 21:31:50 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT = @
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
2009-10-30 14:27:16 +00:00
|
|
|
OUTPUT=mktccboot.exe
|
2009-10-29 21:31:50 +00:00
|
|
|
CFLAGS+=-mno-cygwin
|
|
|
|
else
|
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
2009-10-30 14:27:16 +00:00
|
|
|
OUTPUT=mktccboot.exe
|
2009-10-29 21:31:50 +00:00
|
|
|
else
|
|
|
|
ifeq ($(findstring mingw,$(CC)),mingw)
|
2009-10-30 14:27:16 +00:00
|
|
|
OUTPUT=mktccboot.exe
|
2009-10-29 21:31:50 +00:00
|
|
|
else
|
2009-10-30 14:27:16 +00:00
|
|
|
OUTPUT=mktccboot
|
2009-10-29 21:31:50 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef RBARCH
|
|
|
|
CFLAGS += -arch $(RBARCH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
OUT = $(TARGET_DIR)build$(RBARCH)
|
|
|
|
|
|
|
|
all: $(OUTPUT)
|
|
|
|
|
2009-11-04 21:56:40 +00:00
|
|
|
# inputs
|
|
|
|
LIBSOURCES := mktccboot.c $(TOOLSDIR)/telechips.o
|
|
|
|
SOURCES := $(LIBSOURCES) main.c
|
|
|
|
OBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(SOURCES))))
|
|
|
|
LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(LIBSOURCES))))
|
|
|
|
EXTRADEPS :=
|
|
|
|
|
|
|
|
# rule for sources from tools dir
|
|
|
|
$(OUT)/%.o: $(TOOLSDIR)/%.c $(OUT)
|
2009-10-30 21:04:07 +00:00
|
|
|
@echo CC $<
|
2009-11-04 21:56:40 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
|
2009-10-28 21:11:43 +00:00
|
|
|
|
2009-11-04 21:56:40 +00:00
|
|
|
$(OUT)/%.o: %.c $(OUT)
|
2009-10-29 21:31:50 +00:00
|
|
|
@echo CC $<
|
2009-11-04 21:56:40 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-11-04 21:56:40 +00:00
|
|
|
libmktccboot$(RBARCH).a: $(LIBOBJS)
|
2009-10-29 21:31:50 +00:00
|
|
|
@echo AR $@
|
2009-11-04 21:56:40 +00:00
|
|
|
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
|
|
|
|
|
|
|
|
# building the standalone executable
|
|
|
|
$(OUTPUT): $(OBJS) $(EXTRADEPS)
|
|
|
|
@echo LD $@
|
|
|
|
$(SILENT)$(CC) $(CFLAGS) -o$(OUTPUT) $(OBJS) $(EXTRADEPS)
|
2009-10-29 21:31:50 +00:00
|
|
|
|
|
|
|
# some trickery to build ppc and i386 from a single call
|
|
|
|
ifeq ($(RBARCH),)
|
2009-11-28 22:39:00 +00:00
|
|
|
$(TARGET_DIR)libmktccbooti386.a:
|
2009-10-30 14:27:16 +00:00
|
|
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmktccbooti386.a
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-11-28 22:39:00 +00:00
|
|
|
$(TARGET_DIR)libmktccbootppc.a:
|
2009-10-30 14:27:16 +00:00
|
|
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmktccbootppc.a
|
2009-10-29 21:31:50 +00:00
|
|
|
endif
|
|
|
|
|
2009-11-28 22:39:00 +00:00
|
|
|
libmktccboot-universal: $(TARGET_DIR)libmktccbooti386.a $(TARGET_DIR)libmktccbootppc.a
|
2009-10-30 14:27:16 +00:00
|
|
|
@echo lipo $(TARGET_DIR)libmktccboot.a
|
|
|
|
$(SILENT) rm -f $(TARGET_DIR)libmktccboot.a
|
2009-12-13 21:30:28 +00:00
|
|
|
$(SILENT)lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-10-28 21:11:43 +00:00
|
|
|
clean:
|
2009-11-04 21:56:40 +00:00
|
|
|
rm -f $(OUTPUT) $(TARGET_DIR)libmktccboot*.a mktccboot.dmg
|
|
|
|
rm -rf $(OUT)
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-10-30 14:27:16 +00:00
|
|
|
mktccboot-i386:
|
2009-10-29 21:31:50 +00:00
|
|
|
$(MAKE) RBARCH=i386
|
2009-10-30 14:27:16 +00:00
|
|
|
mv mktccboot mktccboot-i386
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-10-30 14:27:16 +00:00
|
|
|
mktccboot-ppc:
|
2009-10-29 21:31:50 +00:00
|
|
|
make RBARCH=ppc
|
2009-10-30 14:27:16 +00:00
|
|
|
mv mktccboot mktccboot-ppc
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-10-30 14:27:16 +00:00
|
|
|
mktccboot-mac: mktccboot-i386 mktccboot-ppc
|
2009-12-13 21:30:28 +00:00
|
|
|
$(SILENT)lipo -create mktccboot-ppc mktccboot-i386 -output mktccboot-mac
|
2009-10-29 21:31:50 +00:00
|
|
|
|
2009-10-30 14:27:16 +00:00
|
|
|
mktccboot.dmg: mktccboot-mac
|
|
|
|
mkdir -p mktccboot-dmg
|
|
|
|
cp -p mktccboot-mac mktccboot-dmg
|
|
|
|
hdiutil create -srcfolder mktccboot-dmg mktccboot.dmg
|
2009-10-29 21:31:50 +00:00
|
|
|
|
|
|
|
$(OUT):
|
|
|
|
@echo MKDIR $(OUT)
|
|
|
|
$(SILENT)mkdir $(OUT)
|
2009-10-30 14:27:16 +00:00
|
|
|
|