Files
Sam Leffler 95f8965986 apps/rust: start of sdk runtime support for Rust apps
Rust application runtime support + equivalents of hello & fibnoacci.

Change-Id: Ica9b0d181387f159169cbe5f219d26c96540a56d
GitOrigin-RevId: 0a14b67ddd9b166a8ba5c13bac37a30204deb3b0
2022-10-06 19:04:10 +00:00

36 lines
1.1 KiB
Makefile

# 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_KATA}/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}