diff options
Diffstat (limited to 'rbutil/mkimxboot/Makefile')
-rw-r--r-- | rbutil/mkimxboot/Makefile | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/rbutil/mkimxboot/Makefile b/rbutil/mkimxboot/Makefile index 9ad21a1966..d2c487c475 100644 --- a/rbutil/mkimxboot/Makefile +++ b/rbutil/mkimxboot/Makefile | |||
@@ -8,24 +8,18 @@ | |||
8 | # We use the SB code available in the Rockbox utils/sbtools directory | 8 | # We use the SB code available in the Rockbox utils/sbtools directory |
9 | 9 | ||
10 | IMXTOOLS_DIR=../../utils/imxtools/sbtools/ | 10 | IMXTOOLS_DIR=../../utils/imxtools/sbtools/ |
11 | CFLAGS += -I$(IMXTOOLS_DIR) -Wall | ||
12 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) | ||
13 | CFLAGS += -std=gnu99 -g -O3 | ||
14 | 11 | ||
15 | # Location to pkg-config binary. | 12 | COMPILEFLAGS := -Wall -g -O3 -I$(IMXTOOLS_DIR) |
16 | PKGCONFIG := pkg-config | 13 | |
14 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) | ||
15 | CFLAGS += -std=gnu99 $(COMPILEFLAGS) | ||
16 | CXXFLAGS += $(COMPILEFLAGS) | ||
17 | 17 | ||
18 | # Distros could use different names for the crypto library. We try a list | 18 | TOMCRYPT_DIR := ../../utils/tomcrypt |
19 | # of candidate names, only one of them should be the valid one. | ||
20 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ | ||
21 | 19 | ||
22 | $(foreach l,$(LIBCRYPTO_NAMES),\ | 20 | CXXFLAGS += -I$(TOMCRYPT_DIR)/src/headers |
23 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) | 21 | CFLAGS += -I$(TOMCRYPT_DIR)/src/headers |
24 | $(foreach l,$(LIBCRYPTO_NAMES),\ | 22 | LDOPTS += -lpthread $(TOMCRYPT_DIR)/librbtomcrypt.a |
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 | ||
29 | 23 | ||
30 | OUTPUT = mkimxboot | 24 | OUTPUT = mkimxboot |
31 | 25 | ||
@@ -33,6 +27,10 @@ OUTPUT = mkimxboot | |||
33 | IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c | 27 | IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c |
34 | LIBSOURCES := dualboot.c mkimxboot.c md5.c \ | 28 | LIBSOURCES := dualboot.c mkimxboot.c md5.c \ |
35 | $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES)) | 29 | $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES)) |
30 | |||
31 | # for now build tomcrypt as part of the lib. | ||
32 | LIBSOURCES += $(addprefix $(TOMCRYPT_DIR),$(TOMCRYPT_SOURCES)) | ||
33 | |||
36 | # inputs for binary only | 34 | # inputs for binary only |
37 | SOURCES := $(LIBSOURCES) main.c | 35 | SOURCES := $(LIBSOURCES) main.c |
38 | # dependencies for binary | 36 | # dependencies for binary |
@@ -43,3 +41,8 @@ include ../libtools.make | |||
43 | # explicit dependencies on dualboot.{c,h} and mkimxboot.h | 41 | # explicit dependencies on dualboot.{c,h} and mkimxboot.h |
44 | $(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h | 42 | $(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h |
45 | $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h | 43 | $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h |
44 | $(BINARY): librbtomcrypt.a | ||
45 | |||
46 | librbtomcrypt.a: | ||
47 | $(MAKE) -C ../../utils/tomcrypt | ||
48 | |||