blob: fd80106b83194f174490187d34f4dbf9593c2f59 [file] [log] [blame]
Amaury Pouly1d121e82017-02-23 11:33:19 +01001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7
8# We use the SB code available in the Rockbox utils/sbtools directory
9UPGTOOLS_DIR=../../utils/nwztools/upgtools/
10CFLAGS += -I$(UPGTOOLS_DIR) -Wall
11# std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE)
12CFLAGS += -std=gnu99 -g -O3
13# dependencies
14# FIXME make it work for windows and maybe embed crypto++
15LDOPTS += `pkg-config --libs libcrypto++`
16
17OUTPUT = mknwzboot
18
19# inputs for lib
20UPGTOOLS_SOURCES = misc.c upg.c fwp.c mg.cpp md5.cpp
Amaury Pouly7de1d8b2017-09-17 22:16:50 +020021LIBSOURCES := mknwzboot.c install_script.c uninstall_script.c \
Amaury Pouly1d121e82017-02-23 11:33:19 +010022 $(addprefix $(UPGTOOLS_DIR),$(UPGTOOLS_SOURCES))
23# inputs for binary only
24SOURCES := $(LIBSOURCES) main.c
25# dependencies for binary
26EXTRADEPS :=
27
28include ../libtools.make
29
30install_script.c install_script.h: install_script.sh $(BIN2C)
31 $(BIN2C) install_script.sh install_script
32
Amaury Pouly7de1d8b2017-09-17 22:16:50 +020033uninstall_script.c uninstall_script.h: uninstall_script.sh $(BIN2C)
34 $(BIN2C) uninstall_script.sh uninstall_script
35
Amaury Pouly1d121e82017-02-23 11:33:19 +010036# explicit dependencies on install_script.{c,h} and mknwzboot.h
Amaury Pouly7de1d8b2017-09-17 22:16:50 +020037$(OBJDIR)mknwzboot.o: install_script.h install_script.c uninstall_script.h uninstall_script.c mknwzboot.h
38$(OBJDIR)main.o: main.c mknwzboot.h