1 # Copyright © 1995-2004, 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_S := $(AROSDIR)/$(AROS_DIR_S)
65 AROS_SYSTEM := $(AROSDIR)/System
66 AROS_WANDERER := $(AROS_SYSTEM)/Wanderer
67 AROS_THEMES := $(AROS_SYSTEM)/Themes
68 AROS_IMAGES := $(AROS_SYSTEM)/Images
69 AROS_TOOLS := $(AROSDIR)/Tools
70 AROS_UTILITIES := $(AROSDIR)/Utilities
71 AROS_TESTS := $(AROSDIR)/Tests
73 AROS_DEVELOPMENT := $(AROSDIR)/$(AROS_DIR_DEVELOPMENT)
74 AROS_INCLUDES := $(AROSDIR)/$(AROS_DIR_INCLUDE)
75 AROS_LIB := $(AROSDIR)/$(AROS_DIR_LIB)
77 AROS_CONTRIB := $(AROSDIR)/$(AROS_DIR_CONTRIB)
79 # The generated files all go under the GENDIR path
80 GENDIR := $(TARGETDIR)/gen
81 SCRIPTDIR := $(GENDIR)/scripts
83 MKDEPEND := $(TOP)/scripts/mkdep
84 FETCH := $(TOP)/scripts/fetch.sh
86 # The paths to the generated tools
87 TOOLDIR := $(HOSTDIR)/tools
88 TOOLLIB := $(TOOLDIR)/libtool.a
89 MMAKE := $(TOOLDIR)/mmake$(HOST_EXE_SUFFIX)
90 ARCHTOOL := $(TOOLDIR)/archtool$(HOST_EXE_SUFFIX)
91 GENMF := $(TOOLDIR)/genmf.py
92 FLEXCAT := $(TOOLDIR)/FlexCat$(HOST_EXE_SUFFIX)
93 FD2INLINE := $(TOOLDIR)/fd2inline$(HOST_EXE_SUFFIX)
94 FD2PRAGMA := $(TOOLDIR)/fd2pragma$(HOST_EXE_SUFFIX)
95 SFDC := $(TOOLDIR)/sfdc$(HOST_EXE_SUFFIX)
96 MODTOOL := $(TOOLDIR)/modtool$(HOST_EXE_SUFFIX)
97 CREATEDTDESC := $(TOOLDIR)/createdtdesc$(HOST_EXE_SUFFIX)
98 AFSLIB := $(TOOLDIR)/libafs.a
99 COPYTOAFS := $(TOOLDIR)/copytoafs$(HOST_EXE_SUFFIX)
100 ILBMTOC := $(TOOLDIR)/ilbmtoc$(HOST_EXE_SUFFIX)
101 ILBMTOICON := $(TOOLDIR)/ilbmtoicon$(HOST_EXE_SUFFIX)
102 GENSETS := $(TOOLDIR)/gensets$(HOST_EXE_SUFFIX)
103 COLLECT-AROS := $(TOOLDIR)/collect-aros$(HOST_EXE_SUFFIX)
104 GENMODULE := $(TOOLDIR)/genmodule$(HOST_EXE_SUFFIX)
105 CXREF := $(TOOLDIR)/cxref$(HOST_EXE_SUFFIX)
107 AROS_CC := $(TARGET_CC)
108 AROS_AS := $(TARGET_AS)
109 AROS_LD := $(TARGET_LD)
111 ifeq "$(DEBUG)" "yes"
114 AROS_STRIP := $(TARGET_STRIP)
116 STRIP := $(AROS_STRIP)
118 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)
120 # At the moment we have two copies of the includes...
121 # This is the AROS includes, minus clib/mlib.
122 GENINCDIR := $(GENDIR)/include
124 # Basic make configuration. No need to edit anything else under here.
127 .SUFFIXES : .c .h .d .s .S
129 .PHONY : all clean setup subdirs
131 # Was debugging enabled? Better set up the options.
133 CONFIG_CFLAGS += $(DEBUG_CFLAGS)
134 CONFIG_AFLAGS += $(DEBUG_AFLAGS)
135 CONFIG_LDFLAGS += $(DEBUG_LDFLAGS)
136 HOST_CFLAGS += $(DEBUG_CFLAGS)
137 HOST_AFLAGS += $(DEBUG_AFLAGS)
138 HOST_LDFLAGS += $(DEBUG_LDFLAGS)
144 # C and assembly flags are set depending upon the directory
145 CFLAGS = $(USER_INCLUDES) $(CONFIG_CFLAGS) $(USER_CFLAGS)
146 AFLAGS = $(USER_AFLAGS) $(CONFIG_AFLAGS)
147 LDFLAGS = $(USER_LDFLAGS) $(CONFIG_LDFLAGS)
149 # Compatibility with old variables
152 OBJDIR := $(GENDIR)/$(CURDIR)
154 EXEDIR := $(AROSDIR)/C
155 LIBDIR := $(AROS_LIB)
156 CONTRIBDIR := $(AROS_CONTRIB)
157 OSGENDIR := $(GENDIR)/rom
158 KOBJSDIR := $(GENDIR)/kobjs
160 # the build system needs to have some tools in the PATH
162 ifeq ($(AROS_PATH_SET),)
163 PATH := $(TOOLDIR):$(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX):$(PATH)
165 export PATH AROS_PATH_SET
168 # Here follow some global variables that can get values through the makefile
169 # and will be handled in make.tail
171 # Dirs to create a makedir rule for