disable volatile register var warnings
[AROS.git] / config / make.cfg.in
blob63061d32db0f9208fb442cb5b21deaa7bcca21da
1 # Copyright © 1995-2016, The AROS Development Team. All rights reserved.
2 # $Id$
4 # Static makefile rule file for AROS.
6 ifneq ($(AROS_TARGET_VARIANT),)
7 AROS_TARGET_SUFFIX=-$(AROS_TARGET_VARIANT)
8 ifeq ($(AROS_TARGET_ARCH),pc)
9 # 'pc' target has 'tiny' variant for boot floppy, which affects only GRUB options.
10 # It should not affect AROS_TARGET_PLATFORM
11 AROS_TARGET_PLATFORM := $(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
12 else
13 AROS_TARGET_PLATFORM := $(AROS_TARGET_VARIANT)-$(AROS_TARGET_CPU)
14 endif
15 else
16 AROS_TARGET_SUFFIX=
17 AROS_TARGET_PLATFORM := $(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
18 endif
20 # All files corresponding to a specific host go here.
21 HOSTDIR     := $(TOP)/bin/$(AROS_HOST_ARCH)-$(AROS_HOST_CPU)
22 TOOLDIR     := $(HOSTDIR)/tools
24 HOSTGENDIR  := $(HOSTDIR)/gen/host
26 # All files corresponding to a specific target go here.
27 TARGETDIR   := $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)
29 GENDIR      := $(TARGETDIR)/gen
31 -include $(GENDIR)/config/make.defaults
32 -include $(GENDIR)/config/make.opts
34 # target.cfg *must* come before host.cfg,
35 # and both must come before build.cfg
36 include $(GENDIR)/config/target.cfg
37 include $(HOSTGENDIR)/config/host.cfg
38 include $(GENDIR)/config/build.cfg
40 # Cross tools installation directory.
41 CROSSTOOLSDIR        := @AROS_CROSSTOOLSDIR@
43 # Files downloaded from the net are put here
44 PORTSSOURCEDIR       := @AROS_PORTSSRCDIR@
45 PORTSDIR             := $(TARGETDIR)/Ports
47 # Distributable Files we generate are put here
48 DISTDIR              := @AROS_BUILDDIR_UNIX@/distfiles
50 # File for AROS gcc cross compiler spec file
51 SPECS                := $(GENDIR)/config/specs
53 # This is the directory structure for an AROS system.
54 AROSDIR              := $(TARGETDIR)/AROS
56 # Relative paths for standard directories
57 AROS_DIR_BOOT        := boot
58 AROS_DIR_C           := C
59 AROS_DIR_CLASSES     := Classes
60 AROS_DIR_DATATYPES   := $(AROS_DIR_CLASSES)/Datatypes
61 AROS_DIR_GADGETS     := $(AROS_DIR_CLASSES)/Gadgets
62 AROS_DIR_DEVS        := Devs
63 AROS_DIR_EXPANSION   := Expansion
64 AROS_DIR_FS          := L
65 AROS_DIR_LIBRARIES   := Libs
66 AROS_DIR_LOCALE      := Locale
67 AROS_DIR_S           := S
68 AROS_DIR_DEVELOPMENT := Development
69 AROS_DIR_INCLUDE     := $(AROS_DIR_DEVELOPMENT)/include
70 AROS_DIR_LIB         := $(AROS_DIR_DEVELOPMENT)/lib
71 AROS_DIR_CONTRIB     := Extras
72 ifeq ($(AROS_TARGET_ARCH),pc)
73 AROS_DIR_ARCH        := boot/$(AROS_TARGET_ARCH)
74 else
75 AROS_DIR_ARCH        := boot/$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)
76 endif
78 # Absolute paths for standard directories
79 AROSARCHDIR          := $(AROSDIR)/$(AROS_DIR_ARCH)
80 AROS_BOOT            := $(AROSDIR)/$(AROS_DIR_BOOT)
81 AROS_C               := $(AROSDIR)/$(AROS_DIR_C)
82 AROS_CLASSES         := $(AROSDIR)/$(AROS_DIR_CLASSES)
83 AROS_CLASSES_ARCH    := $(AROSDIR)/$(AROS_DIR_ARCH)/$(AROS_DIR_CLASSES)
84 AROS_DATATYPES       := $(AROSDIR)/$(AROS_DIR_DATATYPES)
85 AROS_GADGETS         := $(AROSDIR)/$(AROS_DIR_GADGETS)
86 AROS_DEVS            := $(AROSDIR)/$(AROS_DIR_DEVS)
87 AROS_DEVS_ARCH       := $(AROSDIR)/$(AROS_DIR_ARCH)/$(AROS_DIR_DEVS)
88 AROS_EXPANSION       := $(AROSDIR)/$(AROS_DIR_EXPANSION)
89 AROS_FS              := $(AROSDIR)/$(AROS_DIR_FS)
90 AROS_FS_ARCH         := $(AROSDIR)/$(AROS_DIR_ARCH)/$(AROS_DIR_FS)
91 AROS_RESOURCES       := $(AROS_DEVS)
92 AROS_DRIVERS         := $(AROS_DEVS)/Drivers
93 AROS_LIBRARIES       := $(AROSDIR)/$(AROS_DIR_LIBRARIES)
94 AROS_LIBRARIES_ARCH  := $(AROSDIR)/$(AROS_DIR_ARCH)/$(AROS_DIR_LIBRARIES)
95 AROS_LOCALE          := $(AROSDIR)/$(AROS_DIR_LOCALE)
96 AROS_CATALOGS        := $(AROS_LOCALE)/Catalogs
97 AROS_HELP            := $(AROS_LOCALE)/Help
98 AROS_PREFS           := $(AROSDIR)/Prefs
99 AROS_ENVARC          := $(AROS_PREFS)/Env-Archive
100 AROS_PACKAGES        := $(AROS_ENVARC)/SYS/Packages
101 AROS_PRINTERS        := $(AROS_DEVS)/Printers
102 AROS_S               := $(AROSDIR)/$(AROS_DIR_S)
103 AROS_SYSTEM          := $(AROSDIR)/System
104 AROS_WANDERER        := $(AROS_SYSTEM)/Wanderer
105 AROS_THEMES          := $(AROS_PREFS)/Presets/Themes
106 AROS_IMAGES          := $(AROS_SYSTEM)/Images
107 AROS_TOOLS           := $(AROSDIR)/Tools
108 AROS_UTILITIES       := $(AROSDIR)/Utilities
109 AROS_TESTS           := $(AROSDIR)/Tests
111 AROS_DEVELOPMENT     := $(AROSDIR)/$(AROS_DIR_DEVELOPMENT)
112 AROS_INCLUDES        := $(AROSDIR)/$(AROS_DIR_INCLUDE)
113 AROS_LIB             := $(AROSDIR)/$(AROS_DIR_LIB)
115 AROS_CONTRIB         := $(AROSDIR)/$(AROS_DIR_CONTRIB)
117 # The generated files all go under the GENDIR path
118 SCRIPTDIR            := $(GENDIR)/scripts
120 MKDEPEND             := $(SRCDIR)/scripts/mkdep
121 FETCH                := $(SRCDIR)/scripts/fetch.sh
122 CPYDIRREC            := @PYTHON@ $(SRCDIR)/scripts/cpy-dir-rec.py
124 # The paths to the generated tools
125 TOOLDIR         := $(HOSTDIR)/tools
126 TOOLLIB         := $(TOOLDIR)/libtool.a
127 MMAKE           := $(TOOLDIR)/mmake$(HOST_EXE_SUFFIX)
128 ARCHTOOL        := $(TOOLDIR)/archtool$(HOST_EXE_SUFFIX)
129 ELF2HUNK        := $(TOOLDIR)/elf2hunk$(HOST_EXE_SUFFIX)
130 GENMF           := $(TOOLDIR)/genmf.py
131 FLEXCAT         := $(TOOLDIR)/flexcat$(HOST_EXE_SUFFIX)
132 FD2INLINE       := $(TOOLDIR)/fd2inline$(HOST_EXE_SUFFIX)
133 FD2PRAGMA       := $(TOOLDIR)/fd2pragma$(HOST_EXE_SUFFIX)
134 SFDC            := $(TOOLDIR)/sfdc
135 MODTOOL         := $(TOOLDIR)/modtool$(HOST_EXE_SUFFIX)
136 CREATEDTDESC    := $(TOOLDIR)/createdtdesc$(HOST_EXE_SUFFIX)
137 AFSLIB          := $(TOOLDIR)/libafs.a
138 COPYTOAFS       := $(TOOLDIR)/copytoafs$(HOST_EXE_SUFFIX)
139 ILBMTOC         := $(TOOLDIR)/ilbmtoc$(HOST_EXE_SUFFIX)
140 ILBMTOICON      := $(TOOLDIR)/ilbmtoicon$(HOST_EXE_SUFFIX)
141 INFOINFO        := $(TOOLDIR)/infoinfo$(HOST_EXE_SUFFIX)
142 GENSETS         := $(TOOLDIR)/gensets$(HOST_EXE_SUFFIX)
143 COLLECT-AROS    := $(TOOLDIR)/collect-aros$(HOST_EXE_SUFFIX)
144 GENMODULE       := $(TOOLDIR)/genmodule$(HOST_EXE_SUFFIX)
145 SETREV          := $(TOOLDIR)/setrev$(HOST_EXE_SUFFIX)
147 RESIDENT_BEGIN  := compiler/libinit/libentry
148 KICKSTART_BEGIN := compiler/libinit/kickentry
150 AROS_CC         := $(TARGET_CC)
151 ifneq ($(TARGET_CXX),)
152 AROS_CXX        := $(TARGET_CXX)
153 else
154 AROS_CXX        := $(CROSSTOOLSDIR)/$(AROS_TARGET_CPU)-aros-g++
155 endif
156 AROS_CXXEXTS    := cpp cxx cc c++
157 AROS_AS         := $(TARGET_AS)
158 AROS_LD         := $(TARGET_LD)
160 STRIP           := $(TARGET_STRIP)
162 CALL            := env AROS_HOST_ARCH=$(AROS_HOST_ARCH) AROS_HOST_CPU=$(AROS_HOST_CPU) \
163                        AROS_TARGET_ARCH=$(AROS_TARGET_ARCH) AROS_TARGET_CPU=$(AROS_TARGET_CPU) AROS_TARGET_CPU_MODE=$(AROS_TARGET_CPU_MODE) \
164                        AROS_TARGET_VARIANT=$(AROS_TARGET_VARIANT) AROS_TARGET_SUFFIX=$(AROS_TARGET_SUFFIX)
166 # At the moment we have two copies of the includes...
167 # This is the AROS includes, minus clib/mlib.
168 GENINCDIR       := $(GENDIR)/include
170 # Basic make configuration. No need to edit anything else under here.
172 .SUFFIXES :
173 .SUFFIXES : .c .h .d .s .S
175 .PHONY : all clean setup subdirs
177 # Was debugging enabled? Better set up the options.
178 ifeq ($(DEBUG),yes)
179 CONFIG_CFLAGS += $(DEBUG_CFLAGS)
180 CONFIG_AFLAGS += $(DEBUG_AFLAGS)
181 CONFIG_LDFLAGS += $(DEBUG_LDFLAGS)
182 HOST_CFLAGS += $(DEBUG_CFLAGS)
183 HOST_CXXFLAGS += $(DEBUG_CFLAGS) $(DEBUG_CXXFLAGS)
184 HOST_AFLAGS += $(DEBUG_AFLAGS)
185 HOST_LDFLAGS += $(DEBUG_LDFLAGS)
186 MECHO   := $(ECHO)
187 else
188 MECHO   := $(NOP)
189 endif
191 # Optimization and instruction set architecture flags
192 CONFIG_CFLAGS += $(OPTIMIZATION_CFLAGS)
193 CONFIG_CFLAGS += $(ISA_FLAGS)
194 CONFIG_AFLAGS += $(ISA_FLAGS)
196 CONFIG_CXXFLAGS := $(subst -Wno-pointer-sign,, $(subst -Werror-implicit-function-declaration,, $(CONFIG_CFLAGS)))
198 # compiler and assembler flags are set depending upon the directory
199 CFLAGS      = $(USER_INCLUDES) $(CONFIG_CFLAGS) $(USER_CFLAGS)
200 CXXFLAGS    = $(USER_INCLUDES) $(CONFIG_CXXFLAGS) $(USER_CXXFLAGS)
201 AFLAGS      = $(USER_AFLAGS) $(CONFIG_AFLAGS)
202 LDFLAGS     = $(USER_LDFLAGS) $(CONFIG_LDFLAGS)
204 # if LTO is desired use these flags ...
205 # NB: make.tmpl builds the objects individualy
206 #     so we dont include -fwhole-program for
207 #     binaries by default.
208 LTO_CFLAGS  = $(CFLAGS_LTO)
209 LTO_BINARY_CFLAGS = $(LTO_CFLAGS)
210 LTO_BINARYWHOLE_CFLAGS = $(LTO_BINARY_CFLAGS) $(CFLAGS_WHOLE_PROGRAM)
212 # Apple iOS stuff for gcc
213 IOS_LDFLAGS  := -F$(IOS_SDK_PATH)/System/Library/Frameworks
215 # Compatibility with old variables
216 OBJDIR          :=      $(GENDIR)/$(CURDIR)
217 LIBDIR          :=      $(AROS_LIB)
218 OSGENDIR        :=      $(GENDIR)/rom
219 KOBJSDIR        :=      $(GENDIR)/kobjs
221 # the build system needs to have some tools in the PATH
223 ifeq ($(AROS_PATH_SET),)
224     TMP_TOOLDIR       := $(shell echo $(TOOLDIR) | sed 's/^\(.\):\//\/\1\//')
225     TMP_CROSSTOOLSDIR := $(shell echo $(CROSSTOOLSDIR) | sed 's/^\(.\):\//\/\1\//')
226     PATH := $(TMP_CROSSTOOLSDIR):$(TMP_TOOLDIR):$(TMP_TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX):$(PATH)
227     AROS_PATH_SET := yes
228     export PATH AROS_PATH_SET
229 endif
231 # Here follow some global variables that can get values through the makefile
232 # and will be handled in make.tail
234 # Dirs to create a makedir rule for
235 GLOB_MKDIRS :=
237 # Source directory is added to the target search path
238 VPATH := $(shell echo $(SRCDIR)/$(CURDIR) | sed 's/^\(.\):\//\/\1\//')
240 # Macro for expanding wildcards in source directory
241 # We use shell script here in order to avoid Unicode file names that are listed by pattern expansion but can't be accessed
242 # because of failing Unicode->ACP conversion under Windows
243 WILDCARD = $(shell cd $(SRCDIR)/$(CURDIR); for file in $(1); do if [ -f $$file ]; then printf "%s" "$$file "; fi; done)