1 # Copyright © 1995-2007, 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 # All files corresponding to a specific target go here.
17 TARGETDIR := $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)
19 -include $(TARGETDIR)/gen/config/make.defaults
20 -include $(TARGETDIR)/gen/config/make.opts
22 # target.cfg *must* come before host.cfg
23 include $(TARGETDIR)/gen/config/target.cfg
24 include $(HOSTDIR)/gen/config/host.cfg
26 # Files downloaded from the net are put here
27 PORTSDIR := $(TOP)/distfiles
29 # File for AROS gcc cross compiler spec file
30 SPECS := $(TARGETDIR)/gen/config/specs
32 # This is the directory structure for an AROS system.
33 AROSDIR := $(TARGETDIR)/AROS
35 # Relative paths for standard directories
37 AROS_DIR_CLASSES := Classes
38 AROS_DIR_DATATYPES := $(AROS_DIR_CLASSES)/Datatypes
39 AROS_DIR_GADGETS := $(AROS_DIR_CLASSES)/Gadgets
42 AROS_DIR_LOCALE := Locale
44 AROS_DIR_DEVELOPMENT := Development
45 AROS_DIR_INCLUDE := $(AROS_DIR_DEVELOPMENT)/include
46 AROS_DIR_LIB := $(AROS_DIR_DEVELOPMENT)/lib
47 AROS_DIR_CONTRIB := Extras
49 # Absolute paths for standard directories
50 AROS_C := $(AROSDIR)/$(AROS_DIR_C)
51 AROS_CLASSES := $(AROSDIR)/$(AROS_DIR_CLASSES)
52 AROS_DATATYPES := $(AROSDIR)/$(AROS_DIR_DATATYPES)
53 AROS_GADGETS := $(AROSDIR)/$(AROS_DIR_GADGETS)
54 AROS_DEVS := $(AROSDIR)/$(AROS_DIR_DEVS)
55 AROS_FS := $(AROS_DEVS)
56 AROS_RESOURCES := $(AROS_DEVS)
57 AROS_DRIVERS := $(AROS_DEVS)/Drivers
58 AROS_LIBS := $(AROSDIR)/$(AROS_DIR_LIBS)
59 AROS_LOCALE := $(AROSDIR)/$(AROS_DIR_LOCALE)
60 AROS_CATALOGS := $(AROS_LOCALE)/Catalogs
61 AROS_HELP := $(AROS_LOCALE)/Help
62 AROS_PREFS := $(AROSDIR)/Prefs
63 AROS_ENVARC := $(AROS_PREFS)/Env-Archive
64 AROS_PACKAGES := $(AROS_ENVARC)/SYS/Packages
65 AROS_S := $(AROSDIR)/$(AROS_DIR_S)
66 AROS_SYSTEM := $(AROSDIR)/System
67 AROS_WANDERER := $(AROS_SYSTEM)/Wanderer
68 AROS_THEMES := $(AROS_SYSTEM)/Themes
69 AROS_IMAGES := $(AROS_SYSTEM)/Images
70 AROS_TOOLS := $(AROSDIR)/Tools
71 AROS_UTILITIES := $(AROSDIR)/Utilities
72 AROS_TESTS := $(AROSDIR)/Tests
74 AROS_DEVELOPMENT := $(AROSDIR)/$(AROS_DIR_DEVELOPMENT)
75 AROS_INCLUDES := $(AROSDIR)/$(AROS_DIR_INCLUDE)
76 AROS_LIB := $(AROSDIR)/$(AROS_DIR_LIB)
78 AROS_CONTRIB := $(AROSDIR)/$(AROS_DIR_CONTRIB)
80 # The generated files all go under the GENDIR path
81 GENDIR := $(TARGETDIR)/gen
82 SCRIPTDIR := $(GENDIR)/scripts
84 MKDEPEND := $(TOP)/scripts/mkdep
85 FETCH := $(TOP)/scripts/fetch.sh
87 # The paths to the generated tools
88 TOOLDIR := $(HOSTDIR)/tools
89 TOOLLIB := $(TOOLDIR)/libtool.a
90 MMAKE := $(TOOLDIR)/mmake$(HOST_EXE_SUFFIX)
91 ARCHTOOL := $(TOOLDIR)/archtool$(HOST_EXE_SUFFIX)
92 GENMF := $(TOOLDIR)/genmf.py
93 FLEXCAT := $(TOOLDIR)/FlexCat$(HOST_EXE_SUFFIX)
94 FD2INLINE := $(TOOLDIR)/fd2inline$(HOST_EXE_SUFFIX)
95 FD2PRAGMA := $(TOOLDIR)/fd2pragma$(HOST_EXE_SUFFIX)
96 SFDC := $(TOOLDIR)/sfdc$(HOST_EXE_SUFFIX)
97 MODTOOL := $(TOOLDIR)/modtool$(HOST_EXE_SUFFIX)
98 CREATEDTDESC := $(TOOLDIR)/createdtdesc$(HOST_EXE_SUFFIX)
99 AFSLIB := $(TOOLDIR)/libafs.a
100 COPYTOAFS := $(TOOLDIR)/copytoafs$(HOST_EXE_SUFFIX)
101 ILBMTOC := $(TOOLDIR)/ilbmtoc$(HOST_EXE_SUFFIX)
102 ILBMTOICON := $(TOOLDIR)/ilbmtoicon$(HOST_EXE_SUFFIX)
103 GENSETS := $(TOOLDIR)/gensets$(HOST_EXE_SUFFIX)
104 COLLECT-AROS := $(TOOLDIR)/collect-aros$(HOST_EXE_SUFFIX)
105 GENMODULE := $(TOOLDIR)/genmodule$(HOST_EXE_SUFFIX)
106 CXREF := $(TOOLDIR)/cxref$(HOST_EXE_SUFFIX)
108 AROS_CC := $(TARGET_CC)
109 AROS_AS := $(TARGET_AS)
110 AROS_LD := $(TARGET_LD)
112 ifeq "$(DEBUG)" "yes"
115 AROS_STRIP := $(TARGET_STRIP)
117 STRIP := $(AROS_STRIP)
119 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)
121 # At the moment we have two copies of the includes...
122 # This is the AROS includes, minus clib/mlib.
123 GENINCDIR := $(GENDIR)/include
125 # Basic make configuration. No need to edit anything else under here.
128 .SUFFIXES : .c .h .d .s .S
130 .PHONY : all clean setup subdirs
132 # Was debugging enabled? Better set up the options.
134 CONFIG_CFLAGS += $(DEBUG_CFLAGS)
135 CONFIG_AFLAGS += $(DEBUG_AFLAGS)
136 CONFIG_LDFLAGS += $(DEBUG_LDFLAGS)
137 HOST_CFLAGS += $(DEBUG_CFLAGS)
138 HOST_AFLAGS += $(DEBUG_AFLAGS)
139 HOST_LDFLAGS += $(DEBUG_LDFLAGS)
145 # C and assembly flags are set depending upon the directory
146 CFLAGS = $(USER_INCLUDES) $(CONFIG_CFLAGS) $(USER_CFLAGS)
147 AFLAGS = $(USER_AFLAGS) $(CONFIG_AFLAGS)
148 LDFLAGS = $(USER_LDFLAGS) $(CONFIG_LDFLAGS)
150 # Compatibility with old variables
153 OBJDIR := $(GENDIR)/$(CURDIR)
155 EXEDIR := $(AROSDIR)/C
156 LIBDIR := $(AROS_LIB)
157 CONTRIBDIR := $(AROS_CONTRIB)
158 OSGENDIR := $(GENDIR)/rom
159 KOBJSDIR := $(GENDIR)/kobjs
161 # the build system needs to have some tools in the PATH
163 ifeq ($(AROS_PATH_SET),)
164 PATH := $(TOOLDIR):$(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX):$(PATH)
166 export PATH AROS_PATH_SET
169 # Here follow some global variables that can get values through the makefile
170 # and will be handled in make.tail
172 # Dirs to create a makedir rule for