rockbox/rbutil/mknwzboot/Makefile
Amaury Pouly 7de1d8b70f mknwzboot: add support for uninstallation
There is not need for a bootloader file to create an uninstall firmware so one
needs to provide a model.
Also cleanup the install script a bit by factoring message into a function, also
print them to the log so that the user can report what was printed on the screen
easily. The uninstall script is quite trivial, it remounts the rootfs and restores
the backed up OF to its right place.

Change-Id: I1f5c0efeb965fdc7fe17f45c2753c0f52c34f7f1
2017-09-17 22:16:50 +02:00

38 lines
1.5 KiB
Makefile

# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# We use the SB code available in the Rockbox utils/sbtools directory
UPGTOOLS_DIR=../../utils/nwztools/upgtools/
CFLAGS += -I$(UPGTOOLS_DIR) -Wall
# std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE)
CFLAGS += -std=gnu99 -g -O3
# dependencies
# FIXME make it work for windows and maybe embed crypto++
LDOPTS += `pkg-config --libs libcrypto++`
OUTPUT = mknwzboot
# inputs for lib
UPGTOOLS_SOURCES = misc.c upg.c fwp.c mg.cpp md5.cpp
LIBSOURCES := mknwzboot.c install_script.c uninstall_script.c \
$(addprefix $(UPGTOOLS_DIR),$(UPGTOOLS_SOURCES))
# inputs for binary only
SOURCES := $(LIBSOURCES) main.c
# dependencies for binary
EXTRADEPS :=
include ../libtools.make
install_script.c install_script.h: install_script.sh $(BIN2C)
$(BIN2C) install_script.sh install_script
uninstall_script.c uninstall_script.h: uninstall_script.sh $(BIN2C)
$(BIN2C) uninstall_script.sh uninstall_script
# explicit dependencies on install_script.{c,h} and mknwzboot.h
$(OBJDIR)mknwzboot.o: install_script.h install_script.c uninstall_script.h uninstall_script.c mknwzboot.h
$(OBJDIR)main.o: main.c mknwzboot.h