Oops.
[AROS.git] / config / make.cfg.in
blob4f21dfe6faf42a44496cad9db546a52f5d51bd19
1 # Copyright © 1995-2011, 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
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 include $(GENDIR)/config/target.cfg
36 include $(HOSTGENDIR)/config/host.cfg
38 # Cross tools installation directory.
39 CROSSTOOLSDIR        := @AROS_CROSSTOOLSDIR@
41 # Files downloaded from the net are put here
42 PORTSSOURCEDIR       := @AROS_PORTSSRCDIR@
43 PORTSDIR             := $(TARGETDIR)/Ports
45 # Distributable Files we generate are put here
46 DISTDIR              := @AROS_BUILDDIR_UNIX@/distfiles
48 # File for AROS gcc cross compiler spec file
49 SPECS                := $(GENDIR)/config/specs
51 # This is the directory structure for an AROS system.
52 AROSDIR              := $(TARGETDIR)/AROS
54 # Relative paths for standard directories
55 AROS_DIR_C           := C
56 AROS_DIR_CLASSES     := Classes
57 AROS_DIR_DATATYPES   := $(AROS_DIR_CLASSES)/Datatypes
58 AROS_DIR_GADGETS     := $(AROS_DIR_CLASSES)/Gadgets
59 AROS_DIR_DEVS        := Devs
60 AROS_DIR_FS          := L
61 AROS_DIR_LIBS        := Libs
62 AROS_DIR_LOCALE      := Locale
63 AROS_DIR_S           := S
64 AROS_DIR_DEVELOPMENT := Development
65 AROS_DIR_INCLUDE     := $(AROS_DIR_DEVELOPMENT)/include
66 AROS_DIR_LIB         := $(AROS_DIR_DEVELOPMENT)/lib
67 AROS_DIR_CONTRIB     := Extras
69 # Absolute paths for standard directories
70 AROS_C               := $(AROSDIR)/$(AROS_DIR_C)
71 AROS_CLASSES         := $(AROSDIR)/$(AROS_DIR_CLASSES)
72 AROS_DATATYPES       := $(AROSDIR)/$(AROS_DIR_DATATYPES)
73 AROS_GADGETS         := $(AROSDIR)/$(AROS_DIR_GADGETS)
74 AROS_DEVS            := $(AROSDIR)/$(AROS_DIR_DEVS)
75 AROS_FS              := $(AROSDIR)/$(AROS_DIR_FS)
76 AROS_RESOURCES       := $(AROS_DEVS)
77 AROS_DRIVERS         := $(AROS_DEVS)/Drivers
78 AROS_LIBS            := $(AROSDIR)/$(AROS_DIR_LIBS)
79 AROS_LOCALE          := $(AROSDIR)/$(AROS_DIR_LOCALE)
80 AROS_CATALOGS        := $(AROS_LOCALE)/Catalogs
81 AROS_HELP            := $(AROS_LOCALE)/Help
82 AROS_PREFS           := $(AROSDIR)/Prefs
83 AROS_ENVARC          := $(AROS_PREFS)/Env-Archive
84 AROS_PACKAGES        := $(AROS_ENVARC)/SYS/Packages
85 AROS_PRINTERS        := $(AROS_DEVS)/Printers
86 AROS_S               := $(AROSDIR)/$(AROS_DIR_S)
87 AROS_SYSTEM          := $(AROSDIR)/System
88 AROS_WANDERER        := $(AROS_SYSTEM)/Wanderer
89 AROS_THEMES          := $(AROS_SYSTEM)/Themes
90 AROS_IMAGES          := $(AROS_SYSTEM)/Images
91 AROS_TOOLS           := $(AROSDIR)/Tools
92 AROS_UTILITIES       := $(AROSDIR)/Utilities
93 AROS_TESTS           := $(AROSDIR)/Tests
95 AROS_DEVELOPMENT     := $(AROSDIR)/$(AROS_DIR_DEVELOPMENT)
96 AROS_INCLUDES        := $(AROSDIR)/$(AROS_DIR_INCLUDE)
97 AROS_LIB             := $(AROSDIR)/$(AROS_DIR_LIB)
99 AROS_CONTRIB         := $(AROSDIR)/$(AROS_DIR_CONTRIB)
101 # The generated files all go under the GENDIR path
102 SCRIPTDIR            := $(GENDIR)/scripts
104 MKDEPEND             := $(SRCDIR)/scripts/mkdep
105 FETCH                := $(SRCDIR)/scripts/fetch.sh
106    
107 # The paths to the generated tools
108 TOOLDIR         := $(HOSTDIR)/tools
109 TOOLLIB         := $(TOOLDIR)/libtool.a
110 MMAKE           := $(TOOLDIR)/mmake$(HOST_EXE_SUFFIX)
111 ARCHTOOL        := $(TOOLDIR)/archtool$(HOST_EXE_SUFFIX)
112 ELF2HUNK        := $(TOOLDIR)/elf2hunk$(HOST_EXE_SUFFIX)
113 GENMF           := $(TOOLDIR)/genmf.py
114 FLEXCAT         := $(TOOLDIR)/flexcat$(HOST_EXE_SUFFIX)
115 FD2INLINE       := $(TOOLDIR)/fd2inline$(HOST_EXE_SUFFIX)
116 FD2PRAGMA       := $(TOOLDIR)/fd2pragma$(HOST_EXE_SUFFIX)
117 SFDC            := $(TOOLDIR)/sfdc
118 MODTOOL         := $(TOOLDIR)/modtool$(HOST_EXE_SUFFIX)
119 CREATEDTDESC    := $(TOOLDIR)/createdtdesc$(HOST_EXE_SUFFIX)
120 AFSLIB          := $(TOOLDIR)/libafs.a
121 COPYTOAFS       := $(TOOLDIR)/copytoafs$(HOST_EXE_SUFFIX)
122 ILBMTOC         := $(TOOLDIR)/ilbmtoc$(HOST_EXE_SUFFIX)
123 ILBMTOICON      := $(TOOLDIR)/ilbmtoicon$(HOST_EXE_SUFFIX)
124 INFOINFO        := $(TOOLDIR)/infoinfo$(HOST_EXE_SUFFIX)
125 GENSETS         := $(TOOLDIR)/gensets$(HOST_EXE_SUFFIX)
126 COLLECT-AROS    := $(TOOLDIR)/collect-aros$(HOST_EXE_SUFFIX)
127 GENMODULE       := $(TOOLDIR)/genmodule$(HOST_EXE_SUFFIX)
128 CXREF           := $(TOOLDIR)/cxref$(HOST_EXE_SUFFIX)
129 SETREV          := $(TOOLDIR)/setrev$(HOST_EXE_SUFFIX)
131 RESIDENT_BEGIN  := compiler/libinit/libentry
133 AROS_CC         := $(TARGET_CC)
134 AROS_AS         := $(TARGET_AS)
135 AROS_LD         := $(TARGET_LD)
137 STRIP           := $(TARGET_STRIP)
139 CALL            := env AROS_HOST_ARCH=$(AROS_HOST_ARCH) AROS_HOST_CPU=$(AROS_HOST_CPU) \
140                        AROS_TARGET_ARCH=$(AROS_TARGET_ARCH) AROS_TARGET_CPU=$(AROS_TARGET_CPU) \
141                        AROS_TARGET_VARIANT=$(AROS_TARGET_VARIANT) AROS_TARGET_SUFFIX=$(AROS_TARGET_SUFFIX)
143 # At the moment we have two copies of the includes...
144 # This is the AROS includes, minus clib/mlib.
145 GENINCDIR       := $(GENDIR)/include
147 # Basic make configuration. No need to edit anything else under here.
149 .SUFFIXES :
150 .SUFFIXES : .c .h .d .s .S
152 .PHONY : all clean setup subdirs
154 # Was debugging enabled? Better set up the options.
155 ifeq ($(DEBUG),yes)
156 CONFIG_CFLAGS += $(DEBUG_CFLAGS)
157 CONFIG_AFLAGS += $(DEBUG_AFLAGS)
158 CONFIG_LDFLAGS += $(DEBUG_LDFLAGS)
159 HOST_CFLAGS += $(DEBUG_CFLAGS)
160 HOST_CXXFLAGS += $(DEBUG_CFLAGS) $(DEBUG_CXXFLAGS)
161 HOST_AFLAGS += $(DEBUG_AFLAGS)
162 HOST_LDFLAGS += $(DEBUG_LDFLAGS)
163 MECHO   := $(ECHO)
164 else
165 MECHO   := $(NOP)
166 endif
168 # C and assembly flags are set depending upon the directory
169 CFLAGS      = $(USER_INCLUDES) $(CONFIG_CFLAGS) $(USER_CFLAGS)
170 AFLAGS      = $(USER_AFLAGS) $(CONFIG_AFLAGS)
171 LDFLAGS     = $(USER_LDFLAGS) $(CONFIG_LDFLAGS)
173 # Apple iOS stuff for gcc
174 IOS_LDFLAGS  := -F$(IOS_SDK_PATH)/System/Library/Frameworks
176 # Compatibility with old variables
179 OBJDIR          :=      $(GENDIR)/$(CURDIR)
180 BINDIR          :=      $(AROSDIR)
181 EXEDIR          :=      $(AROSDIR)/C
182 LIBDIR          :=      $(AROS_LIB)
183 CONTRIBDIR      :=      $(AROS_CONTRIB)
184 OSGENDIR        :=      $(GENDIR)/rom
185 KOBJSDIR        :=      $(GENDIR)/kobjs
186 PKGDIR          :=      $(GENDIR)/pkg
188 # the build system needs to have some tools in the PATH
190 ifeq ($(AROS_PATH_SET),)
191     TMP_TOOLDIR       := $(shell echo $(TOOLDIR) | sed 's/^\(.\):\//\/\1\//')
192     TMP_CROSSTOOLSDIR := $(shell echo $(CROSSTOOLSDIR) | sed 's/^\(.\):\//\/\1\//')
193     PATH := $(TMP_CROSSTOOLSDIR):$(TMP_TOOLDIR):$(TMP_TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX):$(PATH)
194     AROS_PATH_SET := yes
195     export PATH AROS_PATH_SET
196 endif
198 # Here follow some global variables that can get values through the makefile
199 # and will be handled in make.tail
201 # Dirs to create a makedir rule for
202 GLOB_MKDIRS :=
204 # Source directory is added to the target search path
205 VPATH := $(shell echo $(SRCDIR)/$(CURDIR) | sed 's/^\(.\):\//\/\1\//')
207 # Macro for expanding wildcards in source directory
208 # We use shell script here in order to avoid Unicode file names that are listed by pattern expansion but can't be accessed
209 # because of failing Unicode->ACP conversion under Windows
210 WILDCARD = $(shell cd $(SRCDIR)/$(CURDIR); for file in $(1); do if [ -f $$file ]; then printf "%s" "$$file "; fi; done)