1 # Copyright © 1995-2010, The AROS Development Team. All rights reserved.
4 # Static makefile rule file for AROS.
6 ifneq ($(AROS_TARGET_VARIANT),)
7 AROS_TARGET_SUFFIX=-$(AROS_TARGET_VARIANT)
12 # All files corresponding to a specific host go here.
13 HOSTDIR := $(TOP)/bin/$(AROS_HOST_ARCH)-$(AROS_HOST_CPU)
14 TOOLDIR := $(HOSTDIR)/tools
16 HOSTGENDIR := $(HOSTDIR)/gen
18 # All files corresponding to a specific target go here.
19 TARGETDIR := $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)
21 GENDIR := $(TARGETDIR)/gen
23 -include $(GENDIR)/config/make.defaults
24 -include $(GENDIR)/config/make.opts
26 # target.cfg *must* come before host.cfg
27 include $(GENDIR)/config/target.cfg
28 include $(HOSTGENDIR)/config/host.cfg
30 # Files downloaded from the net are put here
31 PORTSSOURCEDIR := @AROS_PORTSSRCDIR@
32 PORTSDIR := $(TARGETDIR)/Ports
34 # Distributable Files we generate are put here
35 DISTDIR := @AROS_BUILDDIR_UNIX@/distfiles
37 # File for AROS gcc cross compiler spec file
38 SPECS := $(GENDIR)/config/specs
40 # This is the directory structure for an AROS system.
41 AROSDIR := $(TARGETDIR)/AROS
43 # Relative paths for standard directories
45 AROS_DIR_CLASSES := Classes
46 AROS_DIR_DATATYPES := $(AROS_DIR_CLASSES)/Datatypes
47 AROS_DIR_GADGETS := $(AROS_DIR_CLASSES)/Gadgets
50 AROS_DIR_LOCALE := Locale
52 AROS_DIR_DEVELOPMENT := Development
53 AROS_DIR_INCLUDE := $(AROS_DIR_DEVELOPMENT)/include
54 AROS_DIR_LIB := $(AROS_DIR_DEVELOPMENT)/lib
55 AROS_DIR_CONTRIB := Extras
57 # Absolute paths for standard directories
58 AROS_C := $(AROSDIR)/$(AROS_DIR_C)
59 AROS_CLASSES := $(AROSDIR)/$(AROS_DIR_CLASSES)
60 AROS_DATATYPES := $(AROSDIR)/$(AROS_DIR_DATATYPES)
61 AROS_GADGETS := $(AROSDIR)/$(AROS_DIR_GADGETS)
62 AROS_DEVS := $(AROSDIR)/$(AROS_DIR_DEVS)
63 AROS_FS := $(AROS_DEVS)
64 AROS_RESOURCES := $(AROS_DEVS)
65 AROS_DRIVERS := $(AROS_DEVS)/Drivers
66 AROS_LIBS := $(AROSDIR)/$(AROS_DIR_LIBS)
67 AROS_LOCALE := $(AROSDIR)/$(AROS_DIR_LOCALE)
68 AROS_CATALOGS := $(AROS_LOCALE)/Catalogs
69 AROS_HELP := $(AROS_LOCALE)/Help
70 AROS_PREFS := $(AROSDIR)/Prefs
71 AROS_ENVARC := $(AROS_PREFS)/Env-Archive
72 AROS_PACKAGES := $(AROS_ENVARC)/SYS/Packages
73 AROS_S := $(AROSDIR)/$(AROS_DIR_S)
74 AROS_SYSTEM := $(AROSDIR)/System
75 AROS_WANDERER := $(AROS_SYSTEM)/Wanderer
76 AROS_THEMES := $(AROS_SYSTEM)/Themes
77 AROS_IMAGES := $(AROS_SYSTEM)/Images
78 AROS_TOOLS := $(AROSDIR)/Tools
79 AROS_UTILITIES := $(AROSDIR)/Utilities
80 AROS_TESTS := $(AROSDIR)/Tests
82 AROS_DEVELOPMENT := $(AROSDIR)/$(AROS_DIR_DEVELOPMENT)
83 AROS_INCLUDES := $(AROSDIR)/$(AROS_DIR_INCLUDE)
84 AROS_LIB := $(AROSDIR)/$(AROS_DIR_LIB)
86 AROS_CONTRIB := $(AROSDIR)/$(AROS_DIR_CONTRIB)
88 # The generated files all go under the GENDIR path
89 SCRIPTDIR := $(GENDIR)/scripts
91 MKDEPEND := $(SRCDIR)/scripts/mkdep
92 FETCH := $(SRCDIR)/scripts/fetch.sh
94 # The paths to the generated tools
95 TOOLDIR := $(HOSTDIR)/tools
96 TOOLLIB := $(TOOLDIR)/libtool.a
97 MMAKE := $(TOOLDIR)/mmake$(HOST_EXE_SUFFIX)
98 ARCHTOOL := $(TOOLDIR)/archtool$(HOST_EXE_SUFFIX)
99 GENMF := $(TOOLDIR)/genmf.py
100 FLEXCAT := $(TOOLDIR)/FlexCat$(HOST_EXE_SUFFIX)
101 FD2INLINE := $(TOOLDIR)/fd2inline$(HOST_EXE_SUFFIX)
102 FD2PRAGMA := $(TOOLDIR)/fd2pragma$(HOST_EXE_SUFFIX)
103 SFDC := $(TOOLDIR)/sfdc
104 MODTOOL := $(TOOLDIR)/modtool$(HOST_EXE_SUFFIX)
105 CREATEDTDESC := $(TOOLDIR)/createdtdesc$(HOST_EXE_SUFFIX)
106 AFSLIB := $(TOOLDIR)/libafs.a
107 COPYTOAFS := $(TOOLDIR)/copytoafs$(HOST_EXE_SUFFIX)
108 ILBMTOC := $(TOOLDIR)/ilbmtoc$(HOST_EXE_SUFFIX)
109 ILBMTOICON := $(TOOLDIR)/ilbmtoicon$(HOST_EXE_SUFFIX)
110 GENSETS := $(TOOLDIR)/gensets$(HOST_EXE_SUFFIX)
111 COLLECT-AROS := $(TOOLDIR)/collect-aros$(HOST_EXE_SUFFIX)
112 GENMODULE := $(TOOLDIR)/genmodule$(HOST_EXE_SUFFIX)
113 CXREF := $(TOOLDIR)/cxref$(HOST_EXE_SUFFIX)
115 AROS_CC := $(TARGET_CC)
116 AROS_AS := $(TARGET_AS)
117 AROS_LD := $(TARGET_LD)
119 ifeq "$(DEBUG)" "yes"
122 AROS_STRIP := $(TARGET_STRIP)
124 STRIP := $(AROS_STRIP)
126 CALL := env AROS_HOST_ARCH=$(AROS_HOST_ARCH) AROS_HOST_CPU=$(AROS_HOST_CPU) AROS_TARGET_ARCH=$(AROS_TARGET_ARCH) AROS_TARGET_CPU=$(AROS_TARGET_CPU) AROS_TARGET_VARIANT=$(AROS_TARGET_VARIANT)
128 # At the moment we have two copies of the includes...
129 # This is the AROS includes, minus clib/mlib.
130 GENINCDIR := $(GENDIR)/include
132 # Basic make configuration. No need to edit anything else under here.
135 .SUFFIXES : .c .h .d .s .S
137 .PHONY : all clean setup subdirs
139 # Was debugging enabled? Better set up the options.
141 CONFIG_CFLAGS += $(DEBUG_CFLAGS)
142 CONFIG_AFLAGS += $(DEBUG_AFLAGS)
143 CONFIG_LDFLAGS += $(DEBUG_LDFLAGS)
144 HOST_CFLAGS += $(DEBUG_CFLAGS)
145 HOST_AFLAGS += $(DEBUG_AFLAGS)
146 HOST_LDFLAGS += $(DEBUG_LDFLAGS)
152 # C and assembly flags are set depending upon the directory
153 CFLAGS = $(USER_INCLUDES) $(CONFIG_CFLAGS) $(USER_CFLAGS)
154 AFLAGS = $(USER_AFLAGS) $(CONFIG_AFLAGS)
155 LDFLAGS = $(USER_LDFLAGS) $(CONFIG_LDFLAGS)
157 # Apple iOS stuff for gcc
158 IOS_CFLAGS := -miphoneos-version-min=$(IOS_OS_VERSION)
159 IOS_LDFLAGS := -F$(IOS_SDK_PATH)/System/Library/Frameworks
161 # Compatibility with old variables
164 OBJDIR := $(GENDIR)/$(CURDIR)
166 EXEDIR := $(AROSDIR)/C
167 LIBDIR := $(AROS_LIB)
168 CONTRIBDIR := $(AROS_CONTRIB)
169 OSGENDIR := $(GENDIR)/rom
170 KOBJSDIR := $(GENDIR)/kobjs
172 # the build system needs to have some tools in the PATH
174 ifeq ($(AROS_PATH_SET),)
175 TMP_TOOLDIR := $(shell echo $(TOOLDIR) | sed 's/^\(.\):\//\/\1\//')
176 PATH := $(TMP_TOOLDIR):$(TMP_TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX):$(PATH)
178 export PATH AROS_PATH_SET
181 # Here follow some global variables that can get values through the makefile
182 # and will be handled in make.tail
184 # Dirs to create a makedir rule for
187 # Source directory is added to the target search path
188 VPATH := $(shell echo $(SRCDIR)/$(CURDIR) | sed 's/^\(.\):\//\/\1\//')
190 # Macro for expanding wildcards in source directory
191 # We use shell script here in order to avoid Unicode file names that are listed by pattern expansion but can't be accessed
192 # because of failing Unicode->ACP conversion under Windows
193 WILDCARD = $(shell cd $(SRCDIR)/$(CURDIR); for file in $(1); do if [ -f $$file ]; then printf "%s" "$$file "; fi; done)