|
|
@ -13,8 +13,7 @@ FIPTOOL ?= fiptool${BIN_EXT} |
|
|
|
PROJECT := $(notdir ${FIPTOOL}) |
|
|
|
OBJECTS := fiptool.o tbbr_config.o |
|
|
|
V ?= 0 |
|
|
|
OPENSSL_DIR := /usr |
|
|
|
|
|
|
|
STATIC ?= 0 |
|
|
|
|
|
|
|
override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700 |
|
|
|
HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 |
|
|
@ -24,14 +23,22 @@ else |
|
|
|
HOSTCCFLAGS += -O2 |
|
|
|
endif |
|
|
|
|
|
|
|
INCLUDE_PATHS := -I../../include/tools_share |
|
|
|
|
|
|
|
DEFINES += -DSTATIC=$(STATIC) |
|
|
|
|
|
|
|
ifeq (${STATIC},1) |
|
|
|
LDOPTS := -static |
|
|
|
else |
|
|
|
OPENSSL_DIR := /usr |
|
|
|
|
|
|
|
# Select OpenSSL version flag according to the OpenSSL build selected
|
|
|
|
# from setting the OPENSSL_DIR path.
|
|
|
|
$(eval $(call SELECT_OPENSSL_API_VERSION)) |
|
|
|
|
|
|
|
HOSTCCFLAGS += ${DEFINES} |
|
|
|
# USING_OPENSSL3 flag will be added to the HOSTCCFLAGS variable with the proper
|
|
|
|
# computed value.
|
|
|
|
HOSTCCFLAGS += -DUSING_OPENSSL3=$(USING_OPENSSL3) |
|
|
|
DEFINES += -DUSING_OPENSSL3=$(USING_OPENSSL3) |
|
|
|
|
|
|
|
# Include library directories where OpenSSL library files are located.
|
|
|
|
# For a normal installation (i.e.: when ${OPENSSL_DIR} = /usr or
|
|
|
@ -39,7 +46,11 @@ HOSTCCFLAGS += -DUSING_OPENSSL3=$(USING_OPENSSL3) |
|
|
|
# directory. However, for a local build of OpenSSL, the built binaries are
|
|
|
|
# located under the main project directory (i.e.: ${OPENSSL_DIR}, not
|
|
|
|
# ${OPENSSL_DIR}/lib/).
|
|
|
|
LDLIBS := -L${OPENSSL_DIR}/lib -L${OPENSSL_DIR} -lcrypto |
|
|
|
LDOPTS := -L${OPENSSL_DIR}/lib -L${OPENSSL_DIR} -lcrypto |
|
|
|
INCLUDE_PATHS += -I${OPENSSL_DIR}/include |
|
|
|
endif # STATIC
|
|
|
|
|
|
|
|
HOSTCCFLAGS += ${DEFINES} |
|
|
|
|
|
|
|
ifeq (${V},0) |
|
|
|
Q := @ |
|
|
@ -47,8 +58,6 @@ else |
|
|
|
Q := |
|
|
|
endif |
|
|
|
|
|
|
|
INCLUDE_PATHS := -I../../include/tools_share -I${OPENSSL_DIR}/include |
|
|
|
|
|
|
|
HOSTCC ?= gcc |
|
|
|
|
|
|
|
ifneq (${PLAT},) |
|
|
@ -72,7 +81,7 @@ all: --openssl ${PROJECT} |
|
|
|
|
|
|
|
${PROJECT}: ${OBJECTS} Makefile |
|
|
|
@echo " HOSTLD $@" |
|
|
|
${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} |
|
|
|
${Q}${HOSTCC} ${OBJECTS} -o $@ $(LDOPTS) |
|
|
|
@${ECHO_BLANK_LINE} |
|
|
|
@echo "Built $@ successfully" |
|
|
|
@${ECHO_BLANK_LINE} |
|
|
@ -84,10 +93,11 @@ ${PROJECT}: ${OBJECTS} Makefile |
|
|
|
-include $(DEPS) |
|
|
|
|
|
|
|
--openssl: |
|
|
|
ifeq ($(STATIC),0) |
|
|
|
ifeq ($(DEBUG),1) |
|
|
|
@echo "Selected OpenSSL version: ${OPENSSL_CURRENT_VER}" |
|
|
|
endif |
|
|
|
|
|
|
|
endif # STATIC
|
|
|
|
|
|
|
|
clean: |
|
|
|
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} $(DEPS)) |
|
|
|