fix a typo in the comment.
[AROS.git] / Makefile.in
blob71d5153ed82391321aee0fdfd32ccfc049683dd6
1 # Copyright © 2000-2019, The AROS Development Team. All rights reserved.
2 # $Id$
4 # Main makefile for AROS
6 default: all
8 AROS_BUILD_HOST ?= @aros_build_host@
9 AROS_HOST_CPU ?= @aros_host_cpu@
10 AROS_HOST_ARCH ?= @aros_host_arch@
11 AROS_TARGET_CPU ?= @aros_target_cpu@
12 AROS_TARGET_CPU_MODE ?= @aros_target_cpu_mode@
13 AROS_TARGET_ARCH ?= @aros_target_arch@
14 AROS_TARGET_VARIANT ?= @aros_target_variant@
16 AMIGAOSNDKDIR ?= $(SRCDIR)/local/NDK_3.1
18 # normally, these variable's should go in mmake.config/globalvarfile
19 export AROS_TARGET_BOOTLOADER := @aros_target_bootloader@
20 export AROS_TARGET_ICONSET := @aros_target_iconset@
21 export AROS_GUI_THEME := @aros_target_guitheme@
23 TOP := @AROS_BUILDDIR@
24 SRCDIR := @SRCDIR@
25 include $(TOP)/config/make.cfg
26 ifneq ($(CROSSTOOLS_TARGET),)
27 include $(SRCDIR)/tools/crosstools/$(AROS_TOOLCHAIN).cfg
28 include $(SRCDIR)/tools/crosstools/$(AROS_TOOLCHAIN).deps
29 CROSSTOOLS_BUILDFLAG:=$(CROSSTOOLSDIR)/.installflag-crosstools
30 AROS_TOOLCHAIN_DEPS:=$(AROS_TOOLCHAIN_DEPS) $(SRCDIR)/tools/crosstools/$(AROS_TOOLCHAIN).cfg $(SRCDIR)/tools/crosstools/$(AROS_TOOLCHAIN).deps $(SRCDIR)/tools/crosstools/$(AROS_TOOLCHAIN)/mmakefile.src
31 else
32 CROSSTOOLS_BUILDFLAG:=
33 endif
35 MMAKE_OPTIONS ?= --srcdir=$(SRCDIR) --builddir=$(TOP)
36 ifneq (,$(findstring s,$(MAKEFLAGS)))
37 MMAKE_OPTIONS += -q
38 endif
41 # Rules for Configure generated files ...
44 #$(TOP)/Makefile: $(SRCDIR)/Makefile.in $(TOP)/config.status
45 # @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
46 # @$(TOP)/config.status --silent --file=$@:$<
48 #CONFIGUREFILES += $(TOP)/Makefile
50 $(TOP)/mmake.config: $(SRCDIR)/mmake.config.in $(TOP)/config.status
51 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
52 @$(TOP)/config.status --silent --file=$@:$<
54 CONFIGUREFILES += $(TOP)/mmake.config
55 CONFIGBUILDFILES += $(TOP)/mmake.config
57 $(TOP)/config/make.cfg: $(SRCDIR)/config/make.cfg.in $(TOP)/config.status
58 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
59 @$(TOP)/config.status --silent --file=$@:$<
61 CONFIGUREFILES += $(TOP)/config/make.cfg
62 CONFIGBUILDARCHFILES += $(TOP)/config/make.cfg
64 $(TOP)/compiler/include/geninc.cfg: $(SRCDIR)/compiler/include/geninc.cfg.in $(TOP)/config.status
65 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
66 @$(TOP)/config.status --silent --file=$@:$<
68 CONFIGUREFILES += $(TOP)/compiler/include/geninc.cfg
70 $(AROS_INCLUDES)/aros/config.h: $(SRCDIR)/config/config.h.in $(TOP)/config.status
71 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
72 @$(TOP)/config.status --silent --file=$@:$<
74 CONFIGUREFILES += $(AROS_INCLUDES)/aros/config.h
76 $(GENINCDIR)/aros/config.h: $(SRCDIR)/config/config.h.in $(TOP)/config.status
77 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
78 @$(TOP)/config.status --silent --file=$@:$<
80 CONFIGUREFILES += $(GENINCDIR)/aros/config.h
82 $(GENDIR)/config/target.cfg: $(SRCDIR)/config/target.cfg.in $(TOP)/config.status
83 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
84 @$(TOP)/config.status --silent --file=$@:$<
86 CONFIGUREFILES += $(GENDIR)/config/target.cfg
87 CONFIGBUILDARCHFILES += $(GENDIR)/config/target.cfg
89 $(GENDIR)/config/build.cfg: $(SRCDIR)/config/build.cfg.in $(TOP)/config.status
90 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
91 @$(TOP)/config.status --silent --file=$@:$<
93 CONFIGUREFILES += $(GENDIR)/config/build.cfg
94 CONFIGBUILDARCHFILES += $(GENDIR)/config/build.cfg
96 $(GENDIR)/config/make.defaults: $(SRCDIR)/config/make.defaults.in $(TOP)/config.status
97 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
98 @$(TOP)/config.status --silent --file=$@:$<
100 CONFIGUREFILES += $(GENDIR)/config/make.defaults
102 $(HOSTGENDIR)/config/host.cfg: $(SRCDIR)/config/host.cfg.in $(TOP)/config.status
103 @+$(ECHO) "Regenerating " $(subst $(TOP)/,,$@); \
104 @$(TOP)/config.status --silent --file=$@:$<
106 CONFIGUREFILES += $(HOSTGENDIR)/config/host.cfg
109 # Standard Rules ...
112 all: $(CONFIGUREFILES) crosstools-toolchain features
113 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.AROS
115 makedirs:
116 @$(RM) $(TOP)/errors
117 @$(FOR) dir in $(AROSDIR) $(GENDIR) $(TOOLDIR) ; do \
118 $(IF) [ ! -d $$dir ]; then \
119 $(MECHO) $(MKDIR) "$$dir" ; \
120 $(MKDIR) "$$dir" ; \
121 else true ; fi ; \
122 done
123 @$(IF) [ ! -f $(AROSDIR)/.gdbinit ]; then \
124 $(CP) $(SRCDIR)/_gdbinit $(AROSDIR)/.gdbinit ; \
125 else true ; fi
127 $(PARSEOFFSETS): $(wildcard $(SRCDIR)/tools/parseoffsets/*.[ch])
128 @$(ECHO) Building parseoffsets...
129 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/parseoffsets SRCDIR=$(SRCDIR) TOP=$(TOP)
131 parsesdkoffsets : $(PARSEOFFSETS)
132 @$(IF) [ ! -d $(AMIGAOSNDKDIR) ]; then \
133 $(ECHO) "Please copy the AmigaOS 3.1 (tm) NDK files to $(AMIGAOSNDKDIR)" ; \
134 else \
135 $(ECHO) "Parsing Structure.Offsets file..." ; \
136 $(PARSEOFFSETS) --offsetsfile=$(AMIGAOSNDKDIR)/Includes_Libs/StructOffsets/Structure.Offsets --gendir=$(GENDIR)/tools/parseoffsets --bindir=$(AROS_TESTS)/sdk --sdkdir=$(AROS_INCLUDES) ; \
137 fi ;
139 # Create the tools that are used to build AROS.
140 tools : makedirs mmake $(GENMFSCRIPT) $(ARCHTOOL) $(ELF2HUNK) \
141 $(FLEXCAT) $(CREATEDTDESC) \
142 $(ILBMTOC) $(ILBMTOICON) $(INFOINFO) \
143 $(COLLECT-AROS) $(AFSLIB) $(COPYTOAFS) \
144 $(FD2INLINE) $(FD2PRAGMA) $(SFDC) $(SETREV) $(PARSEOFFSETS)
145 @$(NOP)
147 # rebuild the crosstools if we are reconfigured, or its dependencies change.
148 $(CROSSTOOLSDIR)/.installflag-crosstools: $(TOP)/config.status $(AROS_TOOLCHAIN_DEPS) tools
149 @+$(IF) ! $(TEST) -f $@ ; then \
150 $(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$(CROSSTOOLS_TARGET) && $(TOUCH) $@ ; \
153 crosstools-toolchain: tools $(CROSSTOOLS_BUILDFLAG)
154 @$(NOP)
156 crosstools : crosstools-toolchain features
157 @$(MAKE) $(MKARGS) linklibs-libatomic
159 $(TOP)/config/features.status: $(SRCDIR)/config/features $(CROSSTOOLS_BUILDFLAG)
160 @$(IF) ! $(TEST) -f $@ ; then \
161 $(ECHO) "Querying target compiler features..." ; \
162 cd $(TOP)/config ; CC="$(TARGET_CC) $(TARGET_SYSROOT)" CFLAGS="$(TARGET_CFLAGS) $(DEBUG_CFLAGS) $(OPTIMIZATION_CFLAGS)" CPP="$(TARGET_CPP) $(TARGET_SYSROOT)" CXX="$(TARGET_CXX) $(TARGET_SYSROOT)" CXXFLAGS=" $(TARGET_CXXFLAGS) $(DEBUG_CFLAGS) $(OPTIMIZATION_CFLAGS)" AROS_DEVELOPER="$(AROS_DEVELOPER)" CONFIG_STATUS="features.status" $(SRCDIR)/config/features --host=$(AROS_BUILD_HOST) --with-config-dir=$(GENDIR)/config ; \
165 CONFIGBUILDARCHFILES += $(TOP)/config/features.status
167 features: crosstools-toolchain $(TOP)/config/features.status
168 @$(NOP)
170 NATIVEBUILDFILES = $(addprefix $(AROS_SDK)/,$(notdir $(CONFIGBUILDFILES)))
171 NATIVEBUILDARCHFILES = $(addprefix $(AROS_ARCH_SDK)/config/,$(notdir $(CONFIGBUILDARCHFILES)))
173 $(NATIVEBUILDFILES) $(NATIVEBUILDARCHFILES) : $(CONFIGBUILDFILES) $(CONFIGBUILDARCHFILES)
174 @$(ECHO) "Generating " $(subst $(TOP)/,,$@)
176 $(GENMFSCRIPT): $(SRCDIR)/tools/genmf/genmf.py
177 @$(ECHO) Generating $(subst $(TOP)/,,$(GENMFSCRIPT))...
178 @$(TOP)/config.status --silent --file=$(subst $(TOP)/,,$@):$<
180 $(ELF2HUNK): $(SRCDIR)/tools/elf2hunk/elf2hunk.c
181 @$(ECHO) Building elf2hunk...
182 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/elf2hunk SRCDIR=$(SRCDIR) TOP=$(TOP)
184 $(ARCHTOOL): $(SRCDIR)/tools/archtools/archtool.c
185 @$(ECHO) Building archtool...
186 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/archtools SRCDIR=$(SRCDIR) TOP=$(TOP)
188 $(FLEXCAT): $(wildcard $(SRCDIR)/tools/flexcat/src/*.[ch]) $(wildcard $(SRCDIR)/tools/flexcat/src/sd/*.sd)
189 @$(ECHO) Building flexcat...
190 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/flexcat/src -f Makefile.aros SRCDIR=$(SRCDIR) TOP=$(TOP)
192 $(CREATEDTDESC): $(wildcard $(SRCDIR)/tools/dtdesc/*.[ch]) $(wildcard $(SRCDIR)/tools/dtdesc/c_iff/*.[ch])
193 @$(ECHO) Building createdtdesc...
194 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/dtdesc -f Makefile.aros SRCDIR=$(SRCDIR) TOP=$(TOP)
196 $(AFSLIB): $(wildcard $(SRCDIR)/workbench/devs/afs/*.[ch])
197 @$(ECHO) Building afslib...
198 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/copytoafs -f Makefile.afslib SRCDIR=$(SRCDIR) TOP=$(TOP)
200 $(COPYTOAFS): $(AFSLIB) $(SRCDIR)/tools/copytoafs/copytoafs.c
201 @$(ECHO) Building copytoafs...
202 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/copytoafs SRCDIR=$(SRCDIR) TOP=$(TOP)
204 $(ILBMTOC): $(SRCDIR)/tools/ilbmtoc/ilbmtoc.c
205 @$(ECHO) Building ilbmtoc...
206 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/ilbmtoc SRCDIR=$(SRCDIR) TOP=$(TOP)
208 $(ILBMTOICON): $(SRCDIR)/tools/ilbmtoicon/ilbmtoicon.c
209 @$(ECHO) Building ilbmtoicon...
210 @$(CALL) $(MAKE) $(MKARGS) $@ -C $(SRCDIR)/tools/ilbmtoicon SRCDIR=$(SRCDIR) TOP=$(TOP)
212 $(INFOINFO): $(SRCDIR)/tools/ilbmtoicon/infoinfo.c
213 @$(ECHO) Building infoinfo...
214 @$(CALL) $(MAKE) $(MKARGS) $@ -C $(SRCDIR)/tools/ilbmtoicon SRCDIR=$(SRCDIR) TOP=$(TOP)
216 $(COLLECT-AROS): $(wildcard $(SRCDIR)/tools/collect-aros/*.[hc])
217 @$(ECHO) Building collect-aros...
218 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/collect-aros SRCDIR=$(SRCDIR) TOP=$(TOP)
220 $(FD2INLINE): $(SRCDIR)/tools/fd2inline/fd2inline.c
221 @$(ECHO) Building fd2inline...
222 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2inline SRCDIR=$(SRCDIR) TOP=$(TOP)
224 $(FD2PRAGMA): $(SRCDIR)/tools/fd2pragma/fd2pragma.c
225 @$(ECHO) Building fd2pragma...
226 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2pragma SRCDIR=$(SRCDIR) TOP=$(TOP)
228 $(SFDC): $(SRCDIR)/tools/sfdc/*.pl
229 @$(ECHO) Building sfdc...
230 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/sfdc SRCDIR=$(SRCDIR) TOP=$(TOP)
232 $(SETREV): $(SRCDIR)/tools/setrev/setrev.c
233 @$(ECHO) Building setrev...
234 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/setrev SRCDIR=$(SRCDIR) TOP=$(TOP)
236 # MetaMake apparently requires a slighty different compilation. Probably
237 # because it is sort-of an external package as well.
239 mmake: $(TOP)/tools/MetaMake/Makefile $(MMAKE)
240 @$(NOP)
242 $(SRCDIR)/tools/MetaMake/configure: $(SRCDIR)/tools/MetaMake/configure.in
243 @$(ECHO) Building MetaMake...
244 @cd $(SRCDIR)/tools/MetaMake && @aros_host_aclocal@ && @aros_host_autoconf@
246 $(TOP)/tools/MetaMake/Makefile: $(SRCDIR)/tools/MetaMake/configure $(SRCDIR)/tools/MetaMake/Makefile.in
247 @$(IF) [ ! -d $(TOP)/tools/MetaMake ]; then \
248 $(MECHO) $(MKDIR) "$(TOP)/tools/MetaMake" ; \
249 $(MKDIR) "$(TOP)/tools/MetaMake"; \
251 @cd $(TOP)/tools/MetaMake ; CC="$(HOST_CC)" CFLAGS="$(HOST_CFLAGS) -D_FILE_OFFSET_BITS=64" LDFLAGS="$(HOST_LDFLAGS)" $(SRCDIR)/tools/MetaMake/configure --prefix=$(TOOLDIR) --bindir=$(TOOLDIR) --with-objfiledir=$(HOSTGENDIR)/tools/MetaMake
253 $(MMAKE): $(TOP)/tools/MetaMake/Makefile $(wildcard $(SRCDIR)/tools/MetaMake/*.[ch]) $(GENMFSCRIPT)
254 @$(MAKE) $(MKARGS) AUTOHEADER=@aros_host_autoheader@ -C $(TOP)/tools/MetaMake
255 @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake install
257 # Clean the sources and tools
258 clean:
259 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.clean
260 @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake clean SRCDIR=$(SRCDIR) TOP=$(TOP)
261 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/flexcat/src -f Makefile.aros clean SRCDIR=$(SRCDIR) TOP=$(TOP)
262 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/archtools clean SRCDIR=$(SRCDIR) TOP=$(TOP)
263 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/genmf clean
264 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/dtdesc -f Makefile.aros clean SRCDIR=$(SRCDIR) TOP=$(TOP)
265 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/collect-aros clean SRCDIR=$(SRCDIR) TOP=$(TOP)
266 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2inline clean SRCDIR=$(SRCDIR) TOP=$(TOP)
267 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2pragma clean SRCDIR=$(SRCDIR) TOP=$(TOP)
268 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/sfdc clean SRCDIR=$(SRCDIR) TOP=$(TOP)
269 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/setrev clean SRCDIR=$(SRCDIR) TOP=$(TOP)
270 -@$(RM) $(ARCHDIR) Makefile config.cache config.status config.log \
271 mmake.cache mmake.config rom/mmakefile config/make.cfg \
272 $(AROS_DEVELOPMENT)/include/aros/config.h \
273 $(GENDIR)/include/aros/config.h $(HOSTGENDIR)/config/host.cfg \
274 $(GENDIR)/config/target.cfg $(GENDIR)/config/make.defaults \
275 $(GENDIR)/config/specs \
276 $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-gcc \
277 $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-ld \
278 $(GENDIR)/scripts/genshared $(TOOLDIR)/genmf.py \
279 tools/adflib/myconf.aros tools/collect-aros/env.h
281 # Clean the sources and tools
282 arch-clean: clean
283 @$(NOP)
285 # Really clean all - like a clean checkout
286 dist-clean: arch-clean
287 @$(NOP)
289 sdk : crosstools features $(CONFIGUREFILES) $(NATIVEBUILDFILES) $(NATIVEBUILDARCHFILES)
290 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
292 sdk-test: parsesdkoffsets crosstools features $(CONFIGUREFILES)
293 @$(CALL) $(MAKE) $(MKARGS) -C $(GENDIR)/tools/parseoffsets SRCDIR=$(SRCDIR) TOP=$(TOP) test-sdk-headers-genfiles
295 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
296 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts:
297 @$(NOP)
299 # targets which do not generate files or for which a file/directory exists
300 .PHONY: default all makedirs tools crosstools features docs clean arch-clean dist-clean install \
301 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts \
302 test kernel boot workbench compiler contrib ports sdk mmake query
304 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
305 install test kernel boot workbench compiler contrib ports : crosstools-toolchain features $(CONFIGUREFILES)
306 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
309 # Bypass crosstools target.
310 query: tools
311 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
313 # Map MetaTargets to make targets : Call mmake with AROS.target
314 # This does not allow to check for dependancies, so it is not suitable for
315 # Calling standard main targets, but is usable as a shortcut for MetaMake
316 # if it was not installed globally
319 distfiles::
320 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
322 # The '%-quick' and '%-clean' targets are special - we don't want to wait around
323 # for building crosstools if we just want to build one subtarget
324 %-quick %-clean:
325 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
327 .DEFAULT: $(CONFIGUREFILES)
328 @$(MAKE) $(MKARGS) crosstools-toolchain
329 @$(MAKE) $(MKARGS) crosstools-toolchain features
330 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@