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