Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 1 | # __________ __ ___. |
| 2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 6 | # \/ \/ \/ \/ \/ |
| 7 | |
Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 8 | # We use the SB code available in the Rockbox utils/sbtools directory |
Solomon Peachy | 07084f6 | 2019-01-24 07:31:07 -0500 | [diff] [blame] | 9 | |
Amaury Pouly | a87a9ef | 2012-05-23 11:03:35 +0200 | [diff] [blame] | 10 | IMXTOOLS_DIR=../../utils/imxtools/sbtools/ |
Dominik Riebeling | c5530d9 | 2012-01-02 16:59:26 +0000 | [diff] [blame] | 11 | CFLAGS += -I$(IMXTOOLS_DIR) -Wall |
Dominik Riebeling | 79a56fa | 2014-06-30 17:58:37 +0200 | [diff] [blame] | 12 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) |
| 13 | CFLAGS += -std=gnu99 -g -O3 |
Cástor Muñoz | d645272 | 2017-04-13 21:58:16 +0200 | [diff] [blame] | 14 | |
Solomon Peachy | 07084f6 | 2019-01-24 07:31:07 -0500 | [diff] [blame] | 15 | # Location to pkg-config binary. |
| 16 | PKGCONFIG := pkg-config |
| 17 | |
Cástor Muñoz | d645272 | 2017-04-13 21:58:16 +0200 | [diff] [blame] | 18 | # Distros could use different names for the crypto library. We try a list |
| 19 | # of candidate names, only one of them should be the valid one. |
Cástor Muñoz | d645272 | 2017-04-13 21:58:16 +0200 | [diff] [blame] | 20 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ |
Solomon Peachy | 07084f6 | 2019-01-24 07:31:07 -0500 | [diff] [blame] | 21 | |
Cástor Muñoz | d645272 | 2017-04-13 21:58:16 +0200 | [diff] [blame] | 22 | $(foreach l,$(LIBCRYPTO_NAMES),\ |
| 23 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) |
Solomon Peachy | 07084f6 | 2019-01-24 07:31:07 -0500 | [diff] [blame] | 24 | $(foreach l,$(LIBCRYPTO_NAMES),\ |
| 25 | $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) |
| 26 | $(foreach l,$(LIBCRYPTO_NAMES),\ |
| 27 | $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) |
| 28 | LDOPTS += -lpthread |
Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 29 | |
Dominik Riebeling | b52a9cc | 2011-12-14 22:00:47 +0000 | [diff] [blame] | 30 | OUTPUT = mkimxboot |
Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 31 | |
Dominik Riebeling | b52a9cc | 2011-12-14 22:00:47 +0000 | [diff] [blame] | 32 | # inputs for lib |
Amaury Pouly | 759a78e | 2017-01-03 16:09:34 +0100 | [diff] [blame] | 33 | IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c |
Dominik Riebeling | b52a9cc | 2011-12-14 22:00:47 +0000 | [diff] [blame] | 34 | LIBSOURCES := dualboot.c mkimxboot.c md5.c \ |
| 35 | $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES)) |
| 36 | # inputs for binary only |
Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 37 | SOURCES := $(LIBSOURCES) main.c |
Dominik Riebeling | b52a9cc | 2011-12-14 22:00:47 +0000 | [diff] [blame] | 38 | # dependencies for binary |
| 39 | EXTRADEPS := |
| 40 | |
| 41 | include ../libtools.make |
Amaury Pouly | 303c486 | 2011-11-06 19:44:03 +0000 | [diff] [blame] | 42 | |
| 43 | # explicit dependencies on dualboot.{c,h} and mkimxboot.h |
| 44 | $(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h |
| 45 | $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h |