| # 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. |
| |
| MYDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) |
| |
| include $(MYDIR)/common.mk |
| |
| BUILD_DIR := $(BUILD_ROOT)/$(APPNAME) |
| INTERMEDIATES := ${BUILD_DIR}/lib${APPNAME}.a |
| |
| $(BUILD_DIR)/$(APPNAME).elf: lib${APPNAME} ${LIB_LIBC} | $(BUILD_DIR) |
| $(LD) $(LDFLAGS) -o $(BUILD_DIR)/$(APPNAME).elf $(INTERMEDIATES) $(LIB_LIBC) |
| |
| lib${APPNAME}: |
| SEL4_OUT_DIR=${OUT_CANTRIP}/kernel \ |
| ${CARGO} build ${CARGO_OPTS} --target-dir ${BUILD_DIR} --out-dir ${BUILD_DIR} |
| |
| $(BUILD_DIR): |
| mkdir -p $(BUILD_DIR) |
| |
| clean: |
| rm -rf $(BUILD_DIR) |
| |
| .PHONY: clean lib${APPNAME} |