2023-03-28 06:50:11 +02:00
|
|
|
############################################################################
|
|
|
|
# tools/Zig.defs
|
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you 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
|
|
|
|
#
|
|
|
|
# http://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.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
ZIG := zig
|
|
|
|
|
2023-03-30 09:08:18 +02:00
|
|
|
ifeq ($(CONFIG_ARCH_ARM),y)
|
2023-03-28 06:50:11 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARM_THUMB),y)
|
|
|
|
ZIGFLAGS := -target thumb-freestanding-$(LLVM_ABITYPE)
|
|
|
|
else
|
|
|
|
ZIGFLAGS := -target arm-freestanding-$(LLVM_ABITYPE)
|
|
|
|
endif
|
|
|
|
|
2023-03-30 09:08:18 +02:00
|
|
|
else ifeq ($(CONFIG_ARCH_RISCV),y)
|
2023-03-28 06:50:11 +02:00
|
|
|
|
2023-03-30 09:08:18 +02:00
|
|
|
ZIGFLAGS := -target $(LLVM_ARCHTYPE)-freestanding-none
|
|
|
|
ZIGFLAGS += -mcmodel=medium
|
|
|
|
|
|
|
|
else
|
|
|
|
ZIGFLAGS := -target $(LLVM_ARCHTYPE)-freestanding-$(LLVM_ABITYPE)
|
2023-03-28 06:50:11 +02:00
|
|
|
endif
|
2023-03-30 09:08:18 +02:00
|
|
|
|
|
|
|
# Convert cortex-xxx/sifive-exx to cortex_xxx/sifive_exx
|
|
|
|
|
|
|
|
ZIGFLAGS += -mcpu $(subst -,_,$(LLVM_CPUTYPE))
|