48 lines
1.1 KiB
Makefile
48 lines
1.1 KiB
Makefile
.PHONY:all
|
|
export SOC
|
|
|
|
ifeq ($(CHIP),)
|
|
$(error you must set valid CHIP: ss524v100 or ss522v100 or ss615v100!)
|
|
endif
|
|
|
|
ifeq ($(CHIP), ss615v100)
|
|
SOC := ss524v100
|
|
else
|
|
SOC := $(CHIP:"%"=%)
|
|
endif
|
|
|
|
SECURE_DIR = ddr_init/securelib
|
|
SECURE_CODE := $(wildcard $(SECURE_DIR)/*.c)
|
|
|
|
LOCAL_CFLAGS := -fPIE
|
|
LOCAL_LDFLAGS := -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -pie
|
|
GCC_VERSION_GE49 := $(shell echo `gcc -dumpversion | cut -f1-2 -d.` \>= 4.9 | sed -e 's/\./*100+/g' | bc)
|
|
ifeq ($(GCC_VERSION_GE49),1)
|
|
LOCAL_CFLAGS += -fstack-protector-strong
|
|
else
|
|
LOCAL_CFLAGS += -fstack-protector-all
|
|
endif
|
|
|
|
all: ddrinit rsa2048pem_gen rsa4096pem_gen u-boot-rsa.bin
|
|
|
|
ddrinit:
|
|
pushd ddr_init;make || exit 1;./mkddrinit.sh u-boot-original.bin;popd
|
|
cp ./ddr_init/ddr_init_reg_info.bin ./
|
|
|
|
rsa2048pem_gen: ddrinit
|
|
sh ./rsa2048pem.sh
|
|
|
|
rsa4096pem_gen: ddrinit
|
|
sh ./rsa4096pem.sh
|
|
|
|
u-boot-rsa.bin: ddrinit rsa2048pem_gen rsa4096pem_gen
|
|
sh ./create_secure_boot.sh
|
|
|
|
clean:
|
|
pushd ddr_init;make clean;popd
|
|
find . -name "*.bin" -exec rm -rf {} \;
|
|
distclean:clean
|
|
rm -fr rsa2048pem/*
|
|
rm -fr rsa4096pem/*
|
|
rm -rf aes_otp_cfg.txt
|