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