blob: dcae7aa0b6e09de9e522a5315da90646f1049f6e [file] [log] [blame]
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ifeq ($(ROOTDIR),)
$(error $$ROOTDIR IS NOT DEFINED -- don\'t forget to source setup.sh)
endif
include $(ROOTDIR)/build/preamble.mk
include $(ROOTDIR)/board/trustzone.mk
bootloader: $(PRODUCT_OUT)/lk.bin $(PRODUCT_OUT)/bl2.img $(PRODUCT_OUT)/fip.bin $(PRODUCT_OUT)/u-boot-env.bin
lk-bin: $(PRODUCT_OUT)/lk.bin
fip-bin: $(PRODUCT_OUT)/fip.bin
bl2-img: $(PRODUCT_OUT)/bl2.img
u-boot-env-bin: $(PRODUCT_OUT)/u-boot-env.bin
$(PRODUCT_OUT)/lk.bin: lk-bootloader | out-dirs
$(LOG) lk.bin extract
find $(PRODUCT_OUT)/packages -name 'lk-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/lk.bin
$(LOG) lk.bin finished
$(PRODUCT_OUT)/fip.bin: excelsior-bootloader | out-dirs
$(LOG) fip.bin extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/fip.bin
$(LOG) fip.bin finished
$(PRODUCT_OUT)/bl2.img: excelsior-bootloader | out-dirs
$(LOG) bl2.img extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/bl2.img
$(LOG) bl2.img finished
$(PRODUCT_OUT)/u-boot-env.bin: excelsior-bootloader | out-dirs
$(LOG) u-boot-env.bin extract
find $(PRODUCT_OUT)/packages -name 'excelsior-bootloader*$(USERSPACE_ARCH)*.deb' | xargs \
dpkg --fsys-tarfile | \
tar --strip-components 2 -C $(PRODUCT_OUT) -xf - ./boot/u-boot-env.bin
$(LOG) u-boot-env.bin finished
.PHONY:: bootloader lk-bin fip-bin bl2-img u-boot-env-bin