blob: 9ad21a1966cbb89406cc0a318a77e8022b479d69 [file] [log] [blame]
Amaury Pouly303c4862011-11-06 19:44:03 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7
Amaury Pouly303c4862011-11-06 19:44:03 +00008# We use the SB code available in the Rockbox utils/sbtools directory
Solomon Peachy07084f62019-01-24 07:31:07 -05009
Amaury Poulya87a9ef2012-05-23 11:03:35 +020010IMXTOOLS_DIR=../../utils/imxtools/sbtools/
Dominik Riebelingc5530d92012-01-02 16:59:26 +000011CFLAGS += -I$(IMXTOOLS_DIR) -Wall
Dominik Riebeling79a56fa2014-06-30 17:58:37 +020012# std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE)
13CFLAGS += -std=gnu99 -g -O3
Cástor Muñozd6452722017-04-13 21:58:16 +020014
Solomon Peachy07084f62019-01-24 07:31:07 -050015# Location to pkg-config binary.
16PKGCONFIG := pkg-config
17
Cástor Muñozd6452722017-04-13 21:58:16 +020018# 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ñozd6452722017-04-13 21:58:16 +020020LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++
Solomon Peachy07084f62019-01-24 07:31:07 -050021
Cástor Muñozd6452722017-04-13 21:58:16 +020022$(foreach l,$(LIBCRYPTO_NAMES),\
23 $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l))))
Solomon Peachy07084f62019-01-24 07:31:07 -050024$(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))))
28LDOPTS += -lpthread
Amaury Pouly303c4862011-11-06 19:44:03 +000029
Dominik Riebelingb52a9cc2011-12-14 22:00:47 +000030OUTPUT = mkimxboot
Amaury Pouly303c4862011-11-06 19:44:03 +000031
Dominik Riebelingb52a9cc2011-12-14 22:00:47 +000032# inputs for lib
Amaury Pouly759a78e2017-01-03 16:09:34 +010033IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c
Dominik Riebelingb52a9cc2011-12-14 22:00:47 +000034LIBSOURCES := dualboot.c mkimxboot.c md5.c \
35 $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES))
36# inputs for binary only
Amaury Pouly303c4862011-11-06 19:44:03 +000037SOURCES := $(LIBSOURCES) main.c
Dominik Riebelingb52a9cc2011-12-14 22:00:47 +000038# dependencies for binary
39EXTRADEPS :=
40
41include ../libtools.make
Amaury Pouly303c4862011-11-06 19:44:03 +000042
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