2011-03-10 05:13:44 +01:00
|
|
|
############################################################################
|
2019-08-09 15:22:39 +02:00
|
|
|
# boards/x86/qemu/qemu-i486/scripts/Make.defs
|
2011-03-10 05:13:44 +01:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# 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
|
2011-03-10 05:13:44 +01:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-10 05:13:44 +01:00
|
|
|
#
|
2021-03-05 10:18:57 +01:00
|
|
|
# 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.
|
2011-03-10 05:13:44 +01:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-19 16:25:18 +02:00
|
|
|
include $(TOPDIR)/.config
|
|
|
|
include $(TOPDIR)/tools/Config.mk
|
2011-03-10 05:13:44 +01:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
|
|
|
ARCHOPTIMIZATION = -g
|
2013-12-20 20:23:42 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
|
|
|
ARCHOPTIMIZATION += -O2
|
2011-03-10 05:13:44 +01:00
|
|
|
endif
|
|
|
|
|
2020-05-18 16:18:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2020-05-20 21:41:57 +02:00
|
|
|
ARCHSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)qemu.ld}"
|
2011-03-10 05:13:44 +01:00
|
|
|
MAXOPTIMIZATION = -O2
|
|
|
|
else
|
2020-05-20 21:41:57 +02:00
|
|
|
ARCHSCRIPT = -T$(BOARD_DIR)$(DELIM)scripts$(DELIM)qemu.ld
|
2011-03-10 05:13:44 +01:00
|
|
|
endif
|
|
|
|
|
2016-07-13 05:01:58 +02:00
|
|
|
ARCHCPUFLAGS = -march=i486 -mtune=i486 -fno-builtin -fno-stack-protector
|
2011-03-10 05:13:44 +01:00
|
|
|
ARCHPICFLAGS = -fpic
|
2015-09-01 18:02:36 +02:00
|
|
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
2011-03-10 05:13:44 +01:00
|
|
|
|
2014-01-18 14:38:50 +01:00
|
|
|
# Check if building a 32-bit target with a 64-bit toolchain
|
|
|
|
|
2016-07-12 07:43:23 +02:00
|
|
|
ifeq ($(CONFIG_ARCH_X86_M32),y)
|
2014-01-18 14:38:50 +01:00
|
|
|
ARCHCPUFLAGS += -m32
|
2016-07-13 05:01:58 +02:00
|
|
|
LDFLAGS += -m elf_i386
|
2011-08-28 14:32:14 +02:00
|
|
|
endif
|
|
|
|
|
2011-03-10 05:13:44 +01:00
|
|
|
# We have to use a cross-development toolchain under Cygwin because the native
|
|
|
|
# Cygwin toolchains don't generate ELF binaries.
|
|
|
|
|
2020-10-25 18:26:55 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
|
2012-10-06 01:01:51 +02:00
|
|
|
CROSSDEV = i486-nuttx-elf-
|
2011-03-10 05:13:44 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
CC = $(CROSSDEV)gcc
|
|
|
|
CPP = $(CROSSDEV)gcc -E
|
|
|
|
LD = $(CROSSDEV)ld
|
2018-03-25 17:25:37 +02:00
|
|
|
STRIP = $(CROSSDEV)strip --strip-unneeded
|
2011-03-10 05:13:44 +01:00
|
|
|
AR = $(CROSSDEV)ar rcs
|
|
|
|
NM = $(CROSSDEV)nm
|
|
|
|
OBJCOPY = $(CROSSDEV)objcopy
|
|
|
|
OBJDUMP = $(CROSSDEV)objdump
|
|
|
|
|
2020-09-24 12:46:51 +02:00
|
|
|
CFLAGS := $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
|
|
|
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
|
|
|
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
2011-03-10 05:13:44 +01:00
|
|
|
|
|
|
|
EXEEXT = .elf
|
|
|
|
|
2012-11-15 19:33:18 +01:00
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
2011-03-10 05:13:44 +01:00
|
|
|
LDFLAGS += -g
|
|
|
|
endif
|