2014-09-05 15:39:35 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/import/Make.defs
|
|
|
|
#
|
2021-06-07 17:31:08 +02: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
|
2014-09-05 15:39:35 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2014-09-05 15:39:35 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02: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.
|
2014-09-05 15:39:35 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-19 10:28:03 +02:00
|
|
|
include $(TOPDIR)/.config
|
|
|
|
include $(TOPDIR)/tools/Config.mk
|
2020-07-01 05:32:21 +02:00
|
|
|
-include $(TOPDIR)/scripts/Config.mk
|
2019-10-01 15:51:01 +02:00
|
|
|
include $(TOPDIR)/scripts/Make.defs
|
2014-09-05 15:39:35 +02:00
|
|
|
|
2014-09-05 20:16:45 +02:00
|
|
|
# Tool related definitions
|
2014-09-05 21:59:20 +02:00
|
|
|
# Compiler
|
2014-09-05 20:16:45 +02:00
|
|
|
|
2020-05-18 18:08:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2014-09-06 00:05:29 +02:00
|
|
|
ARCHCRT0OBJ = "${shell cygpath -w $(TOPDIR)$(DELIM)startup$(DELIM)crt0$(OBJEXT)}"
|
2014-09-05 20:16:45 +02:00
|
|
|
else
|
2014-09-06 00:05:29 +02:00
|
|
|
ARCHCRT0OBJ = $(TOPDIR)$(DELIM)startup$(DELIM)crt0$(OBJEXT)
|
2014-09-05 20:16:45 +02:00
|
|
|
endif
|
|
|
|
|
2020-05-20 10:29:35 +02:00
|
|
|
ARCHINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include}
|
|
|
|
|
|
|
|
ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include}
|
|
|
|
ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)cxx}
|
|
|
|
|
2014-09-08 15:57:05 +02:00
|
|
|
ARCHCFLAGS += -fno-common -pipe
|
|
|
|
ARCHCXXFLAGS += -fno-common -pipe
|
|
|
|
|
|
|
|
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
2014-09-05 20:16:45 +02:00
|
|
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
|
|
|
|
2020-07-16 05:02:29 +02:00
|
|
|
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
2014-09-05 20:16:45 +02:00
|
|
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
|
|
|
|
2020-06-24 14:53:39 +02:00
|
|
|
ifeq ($(LDSTARTGROUP),)
|
|
|
|
LDSTARTGROUP = --start-group
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LDENDGROUP),)
|
|
|
|
LDENDGROUP = --end-group
|
|
|
|
endif
|
|
|
|
|
2014-09-06 00:05:29 +02:00
|
|
|
# ELF module definitions
|
|
|
|
|
2014-09-06 18:31:17 +02:00
|
|
|
CELFFLAGS = $(CFLAGS)
|
|
|
|
CXXELFFLAGS = $(CXXFLAGS)
|
2014-09-06 00:05:29 +02:00
|
|
|
|
2014-09-05 21:59:20 +02:00
|
|
|
# C Pre-processor
|
|
|
|
|
2014-09-05 20:16:45 +02:00
|
|
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
|
|
|
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
2014-09-05 21:59:20 +02:00
|
|
|
|
|
|
|
# Linker
|
|
|
|
|
2020-05-18 18:08:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2014-09-05 21:59:20 +02:00
|
|
|
# Windows-native toolchains
|
2018-07-17 18:42:15 +02:00
|
|
|
LDLIBPATH = -L "${shell cygpath -w $(APPDIR)}" -L "${shell cygpath -w $(TOPDIR)$(DELIM)libs}"
|
2014-09-05 21:59:20 +02:00
|
|
|
else
|
|
|
|
# Linux/Cygwin-native toolchain
|
2020-06-24 05:14:02 +02:00
|
|
|
LDLIBPATH = -L $(TOPDIR)$(DELIM)libs
|
2014-09-05 21:59:20 +02:00
|
|
|
endif
|
|
|
|
|
2014-09-05 23:35:41 +02:00
|
|
|
# Try to get the path to libgcc.a. Of course, this only works for GCC
|
|
|
|
# toolchains.
|
|
|
|
|
2020-06-24 04:57:05 +02:00
|
|
|
LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-file-name=libgcc.a}
|
2014-09-05 23:35:41 +02:00
|
|
|
ifneq ($(LIBGCC),)
|
2018-07-17 18:42:15 +02:00
|
|
|
LDLIBPATH += -L "${shell dirname $(LIBGCC)}"
|
2014-09-05 23:35:41 +02:00
|
|
|
LDLIBS += -lgcc
|
|
|
|
endif
|
2014-09-06 00:05:29 +02:00
|
|
|
|
|
|
|
# ELF module definitions
|
|
|
|
|
|
|
|
LDELFFLAGS = -r -e _start -Bstatic
|
2020-05-18 18:08:15 +02:00
|
|
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
2014-09-06 00:05:29 +02:00
|
|
|
LDELFFLAGS += -T "${shell cygpath -w $(TOPDIR)/scripts/gnu-elf.ld}"
|
|
|
|
else
|
|
|
|
LDELFFLAGS += -T $(TOPDIR)/scripts/gnu-elf.ld
|
|
|
|
endif
|