2011-12-16 20:10:29 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
|
|
|
|
TARGET_DIR ?= $(shell pwd)/
|
2012-02-05 19:03:10 +00:00
|
|
|
CFLAGS += -Wall -W -D_LARGEFILE64_SOURCE
|
2011-12-16 20:10:29 +00:00
|
|
|
|
|
|
|
OUTPUT = sansapatcher
|
|
|
|
|
|
|
|
# inputs
|
|
|
|
LIBSOURCES := sansapatcher.c sansaio-posix.c sansaio-win32.c
|
|
|
|
SOURCES := $(LIBSOURCES) main.c
|
|
|
|
# additional link dependencies for the standalone executable
|
|
|
|
EXTRADEPS :=
|
|
|
|
|
|
|
|
# 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
|
2007-03-15 22:55:36 +00:00
|
|
|
endif
|
|
|
|
|
2011-12-16 20:10:29 +00:00
|
|
|
ifdef WITH_BOOTOBJS
|
2011-12-16 20:10:33 +00:00
|
|
|
BOOTSRC = bootimg_c200.c bootimg_e200.c
|
2011-12-16 20:10:29 +00:00
|
|
|
SOURCES += $(BOOTSRC)
|
|
|
|
CFLAGS += -DWITH_BOOTOBJS
|
|
|
|
endif
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2011-12-16 20:10:29 +00:00
|
|
|
include ../libtools.make
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2011-12-16 20:10:29 +00:00
|
|
|
# find out if we need to link the manifest resource.
|
|
|
|
# Since libtools.make sets up BINARY we check it for the file extension .exe.
|
|
|
|
ifeq ($(findstring exe,$(BINARY)),exe)
|
|
|
|
$(BINARY): $(OBJDIR)sansapatcher-rc.o
|
|
|
|
endif
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2011-12-16 20:10:33 +00:00
|
|
|
$(OBJDIR)main.o: $(BOOTSRC)
|
2011-12-16 20:10:29 +00:00
|
|
|
$(OBJDIR)sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
|
2008-01-20 21:19:37 +00:00
|
|
|
$(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2009-06-13 14:15:50 +00:00
|
|
|
bootimg_c200.c: firmware.mi4 ../tools/bin2c
|
2011-12-16 20:10:29 +00:00
|
|
|
@echo BIN2C $<
|
|
|
|
$(SILENT)../tools/bin2c firmware.mi4 bootimg_c200
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2009-06-13 14:15:50 +00:00
|
|
|
bootimg_e200.c: PP5022.mi4 ../tools/bin2c
|
2011-12-16 20:10:29 +00:00
|
|
|
@echo BIN2C $<
|
|
|
|
$(SILENT)../tools/bin2c PP5022.mi4 bootimg_e200
|
2011-12-16 20:10:33 +00:00
|
|
|
|
2009-06-22 23:06:56 +00:00
|
|
|
../tools/bin2c:
|
2011-12-16 20:10:29 +00:00
|
|
|
$(SILENT)make -C ../tools bin2c
|