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