mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-16 00:22:29 -05:00
sansapatcher: use libtools.make.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31327 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d992536285
commit
472c02d0f7
1 changed files with 39 additions and 50 deletions
|
|
@ -1,62 +1,51 @@
|
||||||
CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE
|
# __________ __ ___.
|
||||||
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
# \/ \/ \/ \/ \/
|
||||||
|
|
||||||
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
TARGET_DIR ?= $(shell pwd)/
|
||||||
OUTPUT=sansapatcher.exe
|
CFLAGS += -Wall -W -D_LARGEFILE64_SOURCE
|
||||||
CROSS=
|
|
||||||
CFLAGS+=-mno-cygwin
|
OUTPUT = sansapatcher
|
||||||
else
|
|
||||||
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
# inputs
|
||||||
OUTPUT=sansapatcher.exe
|
BOOTSRC = bootimg_c200.c bootimg_e200.c
|
||||||
CROSS=
|
LIBSOURCES := sansapatcher.c sansaio-posix.c sansaio-win32.c
|
||||||
CFLAGS+=-D__USE_MINGW_ANSI_STDIO=1
|
SOURCES := $(LIBSOURCES) main.c
|
||||||
else
|
# additional link dependencies for the standalone executable
|
||||||
OUTPUT=sansapatcher
|
EXTRADEPS :=
|
||||||
CROSS=i586-mingw32msvc-
|
|
||||||
endif
|
# Releases of sansapatcher are created with "make RELEASE=1". This
|
||||||
|
# enables BOOTOBJS and uses the VERSION string defined in main.c
|
||||||
|
ifdef RELEASE
|
||||||
|
CFLAGS += -DRELEASE
|
||||||
|
BOOTOBJS=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
NATIVECC = gcc
|
ifdef WITH_BOOTOBJS
|
||||||
CC = $(CROSS)gcc
|
SOURCES += $(BOOTSRC)
|
||||||
WINDRES = $(CROSS)windres
|
CFLAGS += -DWITH_BOOTOBJS
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(OUTPUT)
|
include ../libtools.make
|
||||||
|
|
||||||
sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
# find out if we need to link the manifest resource.
|
||||||
gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
# Since libtools.make sets up BINARY we check it for the file extension .exe.
|
||||||
strip sansapatcher
|
ifeq ($(findstring exe,$(BINARY)),exe)
|
||||||
|
$(BINARY): $(OBJDIR)sansapatcher-rc.o
|
||||||
|
endif
|
||||||
|
|
||||||
sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
|
$(OBJDIR)sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
|
||||||
$(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
|
|
||||||
$(CROSS)strip sansapatcher.exe
|
|
||||||
|
|
||||||
sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
|
|
||||||
$(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o
|
$(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o
|
||||||
|
|
||||||
sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
|
|
||||||
lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
|
|
||||||
|
|
||||||
sansapatcher.dmg: sansapatcher-mac
|
|
||||||
mkdir -p sansapatcher-dmg
|
|
||||||
cp -p sansapatcher-mac sansapatcher-dmg/sansapatcher
|
|
||||||
hdiutil create -srcfolder sansapatcher-dmg sansapatcher.dmg
|
|
||||||
|
|
||||||
sansapatcher-i386: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
|
||||||
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 $(CFLAGS) -o sansapatcher-i386 main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
|
||||||
strip sansapatcher-i386
|
|
||||||
|
|
||||||
sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
|
||||||
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
|
||||||
strip sansapatcher-ppc
|
|
||||||
|
|
||||||
bootimg_c200.c: firmware.mi4 ../tools/bin2c
|
bootimg_c200.c: firmware.mi4 ../tools/bin2c
|
||||||
../tools/bin2c firmware.mi4 bootimg_c200
|
@echo BIN2C $<
|
||||||
|
$(SILENT)../tools/bin2c firmware.mi4 bootimg_c200
|
||||||
|
|
||||||
bootimg_e200.c: PP5022.mi4 ../tools/bin2c
|
bootimg_e200.c: PP5022.mi4 ../tools/bin2c
|
||||||
../tools/bin2c PP5022.mi4 bootimg_e200
|
@echo BIN2C $<
|
||||||
|
$(SILENT)../tools/bin2c PP5022.mi4 bootimg_e200
|
||||||
../tools/bin2c:
|
../tools/bin2c:
|
||||||
make -C ../tools bin2c
|
$(SILENT)make -C ../tools bin2c
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~ sansapatcher.dmg
|
|
||||||
rm -rf sansapatcher-dmg
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue