blob: 0b4fe6a38f478dbc2ce95c5d1aab749e203be909 [file] [log] [blame]
# Copyright 2022 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.
SHODAN_BOOT_ROM_SOURCE_DIR:=$(ROOTDIR)/sw/multihart_boot_rom
SHODAN_BOOT_ROM_BUILD_DIR:=$(OUT)/shodan_boot_rom
SHODAN_BOOT_ROM_BUILD_NINJA_SCRIPT:=$(SHODAN_BOOT_ROM_BUILD_DIR)/build.ninja
SHODAN_BOOT_ROM_ELF:=multihart_boot_rom.elf
$(SHODAN_BOOT_ROM_BUILD_DIR):
@mkdir -p "$(SHODAN_BOOT_ROM_BUILD_DIR)"
$(SHODAN_BOOT_ROM_BUILD_NINJA_SCRIPT): | $(SHODAN_BOOT_ROM_BUILD_DIR)
cmake -B $(SHODAN_BOOT_ROM_BUILD_DIR) -G Ninja $(SHODAN_BOOT_ROM_SOURCE_DIR)
## Build the Shodan boot ROM image
#
# This builds a simple multi-core boot ROM that can bootstrap the Shodan system
# in simulation. Source is in sw/multihart_boot_rom, while output is placed in
# out/shodan_boot_rom
multihart_boot_rom: $(SHODAN_BOOT_ROM_BUILD_NINJA_SCRIPT)
cmake --build $(SHODAN_BOOT_ROM_BUILD_DIR) --target $(SHODAN_BOOT_ROM_ELF)
## Clean the Shodan boot ROM build directory
multihart_boot_rom_clean:
rm -rf $(SHODAN_BOOT_ROM_BUILD_DIR)
.PHONY:: multihart_boot_rom multihart_boot_rom_clean