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
|
|
|
|
2022-02-20 11:00:43 +01:00
|
|
|
ARCHCRT0OBJ = $(call CONVERT_PATH,$(TOPDIR)$(DELIM)startup$(DELIM)crt0$(OBJEXT))
|
2022-11-08 11:39:52 +01:00
|
|
|
ARCHINCLUDES += ${INCSYSDIR_PREFIX}$(TOPDIR)$(DELIM)include
|
2020-05-20 10:29:35 +02:00
|
|
|
|
2022-11-08 11:39:52 +01:00
|
|
|
ARCHXXINCLUDES += ${INCSYSDIR_PREFIX}$(TOPDIR)$(DELIM)include
|
|
|
|
ARCHXXINCLUDES += ${INCSYSDIR_PREFIX}$(TOPDIR)$(DELIM)include$(DELIM)cxx
|
2020-05-20 10:29:35 +02:00
|
|
|
|
2014-09-08 15:57:05 +02:00
|
|
|
ARCHCFLAGS += -fno-common -pipe
|
2022-05-20 06:40:51 +02:00
|
|
|
ARCHCXXFLAGS += -fno-common -nostdinc++ -pipe
|
2014-09-08 15:57:05 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-02-20 11:00:43 +01:00
|
|
|
LDLIBPATH = $(addprefix -L,$(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs))
|
2014-09-05 21:59:20 +02:00
|
|
|
|
2022-01-26 01:42:34 +01:00
|
|
|
# Link with user libraries
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_BUILD_KERNEL),y)
|
2022-10-14 09:01:50 +02:00
|
|
|
LDLIBS += -lmm -lc -lproxies
|
2022-02-23 11:32:51 +01:00
|
|
|
ifeq ($(CONFIG_HAVE_CXX),y)
|
|
|
|
LDLIBS += -lxx
|
|
|
|
endif
|
2022-01-30 03:15:22 +01:00
|
|
|
ifneq ($(CONFIG_LIBM),y)
|
|
|
|
LIBM = ${shell "$(CC)" $(ARCHCPUFLAGS) --print-file-name=libm.a}
|
|
|
|
ifneq ($(LIBM),".")
|
|
|
|
LDLIBPATH += -L "${shell dirname $(LIBM)}"
|
|
|
|
LDLIBS += -lm
|
|
|
|
endif
|
|
|
|
endif
|
2022-01-26 01:42:34 +01: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.
|
|
|
|
|
2022-01-30 03:15:22 +01:00
|
|
|
LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) --print-file-name=libgcc.a}
|
|
|
|
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
|
|
|
|
|
2023-06-27 02:39:53 +02:00
|
|
|
ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
|
|
|
|
LDELFFLAGS += -r
|
|
|
|
endif
|
|
|
|
LDELFFLAGS += -e _start -Bstatic
|
2022-02-20 11:00:43 +01:00
|
|
|
LDELFFLAGS += $(addprefix -T,$(call CONVERT_PATH,$(TOPDIR)/scripts/gnu-elf.ld))
|