summaryrefslogtreecommitdiff
path: root/utils/sansapatcher/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'utils/sansapatcher/Makefile')
-rw-r--r--utils/sansapatcher/Makefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/utils/sansapatcher/Makefile b/utils/sansapatcher/Makefile
new file mode 100644
index 0000000000..85c36c6d14
--- /dev/null
+++ b/utils/sansapatcher/Makefile
@@ -0,0 +1,52 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7
8TARGET_DIR ?= $(shell pwd)/
9CFLAGS += -Wall -W -D_LARGEFILE64_SOURCE
10
11OUTPUT = sansapatcher
12
13# inputs
14LIBSOURCES := sansapatcher.c sansaio-posix.c sansaio-win32.c
15SOURCES := main.c
16# additional link dependencies for the standalone executable
17EXTRADEPS :=
18
19# Releases of sansapatcher are created with "make RELEASE=1". This
20# enables BOOTOBJS and uses the VERSION string defined in main.c
21ifdef RELEASE
22CFLAGS += -DRELEASE
23BOOTOBJS=1
24endif
25
26ifdef WITH_BOOTOBJS
27BOOTSRC = bootimg_c200.c bootimg_e200.c
28SOURCES += $(BOOTSRC)
29CFLAGS += -DWITH_BOOTOBJS
30endif
31
32include ../libtools.make
33
34# find out if we need to link the manifest resource.
35# Since libtools.make sets up BINARY we check it for the file extension .exe.
36ifeq ($(findstring exe,$(BINARY)),exe)
37$(BINARY): $(OBJDIR)sansapatcher-rc.o
38endif
39
40$(OBJDIR)main.o: $(BOOTSRC)
41$(OBJDIR)sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
42 @echo WINDRES $(notdir $<)
43 $(SILENT)$(CROSS)$(WINDRES) -i sansapatcher.rc -o $@
44
45bootimg_c200.c: firmware.mi4 $(BIN2C)
46 @echo BIN2C $<
47 $(SILENT)$(BIN2C) $< $*
48
49bootimg_e200.c: PP5022.mi4 $(BIN2C)
50 @echo BIN2C $< $*
51 $(SILENT)$(BIN2C) $< $*
52