Lorenzo Miori | 66aa00d | 2013-07-23 16:24:19 +0200 | [diff] [blame] | 1 | .PHONY: all clean dirs bmp2rb |
| 2 | CFLAGS += -O1 -g -std=c99 -W -Wall $(DEFINES) |
| 3 | PROGS = bmp2rb fwcrypt fwdecrypt |
| 4 | CROSS_COMPILE = arm-ypr0-linux-gnueabi- |
| 5 | R1_SAFEMODE_DIR = files/r1/etc/safemode |
| 6 | R0_SAFEMODE_DIR = files/r0/etc/safemode |
| 7 | DIRS = $(R1_SAFEMODE_DIR) $(R0_SAFEMODE_DIR) |
| 8 | R1_IMAGES = $(subst .bmp,.raw,$(addprefix $(R1_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r1/*.bmp)))) |
| 9 | R0_IMAGES = $(subst .bmp,.raw,$(addprefix $(R0_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r0/*.bmp)))) |
| 10 | BMP2RB = ../../tools/bmp2rb |
Thomas Martitz | 249bba0 | 2011-12-24 11:56:46 +0000 | [diff] [blame] | 11 | |
Lorenzo Miori | 66aa00d | 2013-07-23 16:24:19 +0200 | [diff] [blame] | 12 | all: $(R1_SAFEMODE_DIR)/cable_detect $(PROGS) $(R1_IMAGES) $(R0_IMAGES) |
| 13 | $(MAKE) -C cramfs-1.1 |
Thomas Martitz | 249bba0 | 2011-12-24 11:56:46 +0000 | [diff] [blame] | 14 | |
Lorenzo Miori | da8a6a9 | 2013-07-09 18:20:08 +0200 | [diff] [blame] | 15 | fwdecrypt: fwdecrypt.o common.o ../../tools/fwpatcher/md5.o |
Lorenzo Miori | da8a6a9 | 2013-07-09 18:20:08 +0200 | [diff] [blame] | 16 | |
| 17 | fwcrypt: fwcrypt.o common.o ../../tools/fwpatcher/md5.o |
Lorenzo Miori | 66aa00d | 2013-07-23 16:24:19 +0200 | [diff] [blame] | 18 | |
| 19 | $(BMP2RB): |
| 20 | $(MAKE) -C ../../tools/ bmp2rb |
| 21 | |
| 22 | $(R1_SAFEMODE_DIR)/cable_detect: cable_detect.c $(R1_SAFEMODE_DIR) |
| 23 | $(CROSS_COMPILE)$(CC) $(CFLAGS) $< -o $@ |
| 24 | |
| 25 | $(R1_SAFEMODE_DIR)/%.raw: files/images/r1/%.bmp $(BMP2RB) $(R1_SAFEMODE_DIR) |
| 26 | $(BMP2RB) -r -f 9 $< > $@ |
| 27 | |
| 28 | $(R0_SAFEMODE_DIR)/%.raw: files/images/r0/%.bmp $(BMP2RB) $(R0_SAFEMODE_DIR) |
| 29 | $(BMP2RB) -r -f 9 $< > $@ |
| 30 | |
| 31 | $(DIRS): |
| 32 | $(SILENT)mkdir -p $@ |
| 33 | |
| 34 | dirs: $(DIRS) |
| 35 | |
| 36 | bmp2rb: $(BMP2RB) |
Thomas Martitz | 249bba0 | 2011-12-24 11:56:46 +0000 | [diff] [blame] | 37 | |
| 38 | clean: |
Lorenzo Miori | 66aa00d | 2013-07-23 16:24:19 +0200 | [diff] [blame] | 39 | $(MAKE) -C cramfs-1.1 clean |
| 40 | rm -f *.o fwdecrypt fwcrypt |
| 41 | rm -rf $(R1_SAFEMODE_DIR)/../../etc $(R0_SAFEMODE_DIR)/../../etc |