diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2021-12-15 21:04:28 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2021-12-24 18:05:53 +0100 |
commit | c876d3bbefe0dc00c27ca0c12d29da5874946962 (patch) | |
tree | 69f468a185a369b01998314bc3ecc19b70f4fcaa /utils/mknwzboot/Makefile | |
parent | 6c6f0757d7a902feb293be165d1490c42bc8e7ad (diff) | |
download | rockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.tar.gz rockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.zip |
rbutil: Merge rbutil with utils folder.
rbutil uses several components from the utils folder, and can be
considered part of utils too. Having it in a separate folder is an
arbitrary split that doesn't help anymore these days, so merge them.
This also allows other utils to easily use libtools.make without the
need to navigate to a different folder.
Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21
Diffstat (limited to 'utils/mknwzboot/Makefile')
-rw-r--r-- | utils/mknwzboot/Makefile | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/utils/mknwzboot/Makefile b/utils/mknwzboot/Makefile new file mode 100644 index 0000000000..3cbb2ef9dd --- /dev/null +++ b/utils/mknwzboot/Makefile | |||
@@ -0,0 +1,52 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | |||
8 | # We use the SB code available in the Rockbox utils/sbtools directory | ||
9 | UPGTOOLS_DIR=../../utils/nwztools/upgtools/ | ||
10 | CFLAGS += -I$(UPGTOOLS_DIR) -Wall | ||
11 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) | ||
12 | CFLAGS += -std=gnu99 -g -O3 | ||
13 | # dependencies | ||
14 | # FIXME make it work for windows and maybe embed crypto++ | ||
15 | |||
16 | # Location to pkg-config binary. | ||
17 | PKGCONFIG := pkg-config | ||
18 | |||
19 | # Distros could use different names for the crypto library. We try a list | ||
20 | # of candidate names, only one of them should be the valid one. | ||
21 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ | ||
22 | |||
23 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
24 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) | ||
25 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
26 | $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
27 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
28 | $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
29 | LDOPTS += -lpthread | ||
30 | |||
31 | OUTPUT = mknwzboot | ||
32 | |||
33 | # inputs for lib | ||
34 | UPGTOOLS_SOURCES = misc.c upg.c fwp.c mg.cpp md5.cpp | ||
35 | LIBSOURCES := mknwzboot.c install_script.c uninstall_script.c \ | ||
36 | $(addprefix $(UPGTOOLS_DIR),$(UPGTOOLS_SOURCES)) | ||
37 | # inputs for binary only | ||
38 | SOURCES := $(LIBSOURCES) main.c | ||
39 | # dependencies for binary | ||
40 | EXTRADEPS := | ||
41 | |||
42 | include ../libtools.make | ||
43 | |||
44 | install_script.c install_script.h: install_script.sh $(BIN2C) | ||
45 | $(BIN2C) install_script.sh install_script | ||
46 | |||
47 | uninstall_script.c uninstall_script.h: uninstall_script.sh $(BIN2C) | ||
48 | $(BIN2C) uninstall_script.sh uninstall_script | ||
49 | |||
50 | # explicit dependencies on install_script.{c,h} and mknwzboot.h | ||
51 | $(OBJDIR)mknwzboot.o: install_script.h install_script.c uninstall_script.h uninstall_script.c mknwzboot.h | ||
52 | $(OBJDIR)main.o: main.c mknwzboot.h | ||