2016-10-19 15:03:52 +00:00
|
|
|
PREFIX?=arm-sony-linux-gnueabi-
|
|
|
|
CC=$(PREFIX)gcc
|
|
|
|
LD=$(PREFIX)gcc
|
|
|
|
CFLAGS=-std=gnu99 -Wall -O2
|
2016-11-11 15:01:14 +00:00
|
|
|
NWZ_DB_DIR=../database
|
|
|
|
INCLUDES=-I. -I$(NWZ_DB_DIR)
|
2016-10-19 15:03:52 +00:00
|
|
|
|
2016-11-11 15:01:14 +00:00
|
|
|
LIB_FILES=nwz_lib.c $(NWZ_DB_DIR)/nwz_db.c
|
2016-10-31 16:50:16 +00:00
|
|
|
TOOL_FILES=dest_tool.c test_adc.c test_adc.c test_bl.c test_display.c \
|
2016-11-05 23:12:04 +00:00
|
|
|
test_keys.c test_power.c test_ts.c test_fb.c
|
2016-11-01 16:04:26 +00:00
|
|
|
ALL_ELF=$(patsubst %.c,%.elf,$(TOOL_FILES)) all_tools.elf dualboot.elf
|
2016-10-19 15:03:52 +00:00
|
|
|
|
2016-10-31 16:50:16 +00:00
|
|
|
all: $(ALL_ELF)
|
2016-10-19 15:03:52 +00:00
|
|
|
|
2016-11-12 21:28:53 +00:00
|
|
|
# image dependency
|
|
|
|
data/rockbox_icon.h data/tools_icon.h:
|
|
|
|
make -C data
|
|
|
|
|
|
|
|
dualboot.elf: data/rockbox_icon.h data/tools_icon.h
|
|
|
|
|
2016-10-19 15:03:52 +00:00
|
|
|
%.elf: %.c $(LIB_FILES)
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^
|
|
|
|
|
2016-10-31 16:50:16 +00:00
|
|
|
all_tools.elf: all_tools.c $(TOOL_FILES) $(LIB_FILES)
|
|
|
|
$(CC) $(CFLAGS) -DNWZ_EMBED_TOOLS $(INCLUDES) -o $@ $^
|
2016-10-19 15:03:52 +00:00
|
|
|
|
2016-11-01 16:04:26 +00:00
|
|
|
dualboot.elf: dualboot.c all_tools.c $(TOOL_FILES) $(LIB_FILES)
|
|
|
|
$(CC) $(CFLAGS) -DNWZ_DUALBOOT -DNWZ_EMBED_TOOLS $(INCLUDES) -o $@ $^
|
|
|
|
|
2016-10-31 16:50:16 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(ALL_ELF)
|