Give Trident 32 KB stack to be on the safe side. It actually needs 16 KB minimum...
[cake.git] / Makefile.in
blobd3356b6be9df38bfb3e47ccd7de94ea4390e57ca
1 # Copyright © 2000-2003, The AROS Development Team. All rights reserved.
2 # $Id$
4 # Main makefile for AROS
6 default: all
8 AROS_HOST_CPU ?= @aros_host_cpu@
9 AROS_HOST_ARCH ?= @aros_host_arch@
10 AROS_TARGET_CPU ?= @aros_target_cpu@
11 AROS_TARGET_ARCH ?= @aros_target_arch@
12 AROS_TARGET_VARIANT ?= @aros_target_variant@
14 # normally, these variable's should go in mmake.config/globalvarfile
15 export AROS_TARGET_BOOTLOADER := @aros_target_bootloader@
16 export AROS_TARGET_ICONSET := @aros_target_iconset@
17 export AROS_GUI_THEME := @aros_target_guitheme@
19 TOP := @AROS_BUILDDIR@
20 SRCDIR := @SRCDIR@
21 include $(TOP)/config/make.cfg
23 MMAKE_OPTIONS ?= --srcdir=$(SRCDIR) --builddir=$(TOP)
25 all: makedirs tools mmake
26 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.AROS
28 makedirs:
29 @$(RM) $(TOP)/errors
30 @$(FOR) dir in $(AROSDIR) $(GENDIR) $(TOOLDIR) ; do \
31 $(IF) [ ! -d $$dir ]; then \
32 $(MECHO) $(MKDIR) "$$dir" ; \
33 $(MKDIR) "$$dir" ; \
34 else true ; fi ; \
35 done
36 @$(IF) [ ! -f $(AROSDIR)/.gdbinit ]; then \
37 $(CP) $(SRCDIR)/_gdbinit $(AROSDIR)/.gdbinit ; \
38 else true ; fi
40 # Create the tools that are used to build AROS.
41 tools : makedirs $(TOOLLIB) $(GENMF) $(ARCHTOOL) \
42 $(FLEXCAT) $(CREATEDTDESC) $(ILBMTOC) $(ILBMTOICON) \
43 $(COLLECT-AROS) $(AFSLIB) $(COPYTOAFS) \
44 $(FD2INLINE) $(FD2PRAGMA) $(SFDC)
46 $(TOOLLIB) : $(wildcard $(SRCDIR)/tools/toollib/*.[ch])
47 @$(ECHO) Building toollib...
48 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/toollib SRCDIR=$(SRCDIR) TOP=$(TOP) CURDIR=toollib
50 $(GENMF) : $(SRCDIR)/tools/genmf/genmf.py
51 @$(ECHO) Copying genmf...
52 @./config.status $(subst $(TOP)/,,$(GENMF)) genmf_executable
54 $(ARCHTOOL) : $(SRCDIR)/tools/archtools/archtool.c
55 @$(ECHO) Building archtool...
56 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/archtools SRCDIR=$(SRCDIR) TOP=$(TOP)
58 $(FLEXCAT) : $(SRCDIR)/tools/FlexCat/flexcat.c
59 @$(ECHO) Building flexcat...
60 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/FlexCat SRCDIR=$(SRCDIR) TOP=$(TOP)
62 $(CREATEDTDESC) : $(wildcard $(SRCDIR)/tools/dtdesc/*.[ch]) $(wildcard $(SRCDIR)/tools/dtdesc/c_iff/*.[ch])
63 @$(ECHO) Building createdtdesc...
64 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/dtdesc -f Makefile.aros SRCDIR=$(SRCDIR) TOP=$(TOP)
66 $(AFSLIB) : $(wildcard $(SRCDIR)/workbench/devs/afs/*.[ch])
67 @$(ECHO) Building afslib...
68 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/copytoafs -f Makefile.afslib SRCDIR=$(SRCDIR) TOP=$(TOP)
70 $(COPYTOAFS) : $(AFSLIB) $(SRCDIR)/tools/copytoafs/copytoafs.c
71 @$(ECHO) Building copytoafs...
72 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/copytoafs SRCDIR=$(SRCDIR) TOP=$(TOP)
74 $(ILBMTOC) : $(SRCDIR)/tools/ilbmtoc/ilbmtoc.c
75 @$(ECHO) Building ilbmtoc...
76 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/ilbmtoc SRCDIR=$(SRCDIR) TOP=$(TOP)
78 $(ILBMTOICON) : $(SRCDIR)/tools/ilbmtoicon/ilbmtoicon.c
79 @$(ECHO) Building ilbmtoicon...
80 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/ilbmtoicon SRCDIR=$(SRCDIR) TOP=$(TOP)
82 $(COLLECT-AROS) : $(wildcard $(SRCDIR)/tools/collect-aros/*.[hc])
83 @$(ECHO) Building collect-aros...
84 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/collect-aros SRCDIR=$(SRCDIR) TOP=$(TOP)
86 $(FD2INLINE) : $(SRCDIR)/tools/fd2inline/fd2inline.c
87 @$(ECHO) Building fd2inline...
88 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2inline SRCDIR=$(SRCDIR) TOP=$(TOP)
90 $(FD2PRAGMA) : $(SRCDIR)/tools/fd2pragma/fd2pragma.c
91 @$(ECHO) Building fd2pragma...
92 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2pragma SRCDIR=$(SRCDIR) TOP=$(TOP)
94 $(SFDC) : $(SRCDIR)/tools/sfdc/*.pl
95 @$(ECHO) Building sfdc...
96 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/sfdc SRCDIR=$(SRCDIR) TOP=$(TOP)
98 # MetaMake apparently requires a slighty different compilation. Probably
99 # because it is sort-of an external package as well.
101 mmake : $(TOP)/tools/MetaMake/Makefile $(MMAKE)
103 $(SRCDIR)/tools/MetaMake/configure : $(SRCDIR)/tools/MetaMake/configure.in
104 @$(ECHO) Building MetaMake...
105 @cd $(SRCDIR)/tools/MetaMake && @aros_host_aclocal@ && @aros_host_autoconf@
107 $(TOP)/tools/MetaMake/Makefile : $(SRCDIR)/tools/MetaMake/configure $(SRCDIR)/tools/MetaMake/Makefile.in
108 @$(IF) [ ! -d $(TOP)/tools/MetaMake ]; then \
109 $(MECHO) $(MKDIR) "$(TOP)/tools/MetaMake" ; \
110 $(MKDIR) "$(TOP)/tools/MetaMake"; \
112 @cd $(TOP)/tools/MetaMake ; CC="$(HOST_CC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" $(SRCDIR)/tools/MetaMake/configure --prefix=$(TOOLDIR) --bindir=$(TOOLDIR) --with-objfiledir=$(HOSTGENDIR)/tools/MetaMake
114 $(MMAKE): $(TOP)/tools/MetaMake/Makefile $(wildcard $(SRCDIR)/tools/MetaMake/*.[ch]) $(GENMF)
115 @$(MAKE) $(MKARGS) AUTOHEADER=@aros_host_autoheader@ -C $(TOP)/tools/MetaMake
116 @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake install
118 # Clean the sources and tools
119 clean:
120 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.clean
121 @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake clean SRCDIR=$(SRCDIR) TOP=$(TOP)
122 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/FlexCat clean SRCDIR=$(SRCDIR) TOP=$(TOP)
123 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/archtools clean SRCDIR=$(SRCDIR) TOP=$(TOP)
124 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/genmf clean
125 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/toollib clean SRCDIR=$(SRCDIR) TOP=$(TOP)
126 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/dtdesc -f Makefile.aros clean SRCDIR=$(SRCDIR) TOP=$(TOP)
127 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/collect-aros clean SRCDIR=$(SRCDIR) TOP=$(TOP)
128 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2inline clean SRCDIR=$(SRCDIR) TOP=$(TOP)
129 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/fd2pragma clean SRCDIR=$(SRCDIR) TOP=$(TOP)
130 @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/sfdc clean SRCDIR=$(SRCDIR) TOP=$(TOP)
131 -@$(RM) $(ARCHDIR) Makefile config.cache config.status config.log mmake.cache mmake.config rom/mmakefile config/make.cfg $(AROS_DEVELOPMENT)/include/aros/config.h $(GENDIR)/include/aros/config.h $(HOSTGENDIR)/config/host.cfg $(GENDIR)/config/target.cfg $(GENDIR)/config/make.defaults $(GENDIR)/config/specs $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-gcc $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-ld $(GENDIR)/scripts/genshared $(TOOLDIR)/genmf.py tools/adflib/myconf.aros tools/collect-aros/env.h
133 # Clean the sources and tools
134 arch-clean: clean
135 @$(NOP)
137 # Really clean all - like a clean checkout
138 dist-clean: arch-clean
139 @$(NOP)
141 # Dependencies don't work with .DEFAULT :-(
142 docs : makedirs tools mmake
143 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.docs
145 all-docs : makedirs tools mmake
146 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.all-docs
148 sdk : makedirs tools mmake
149 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.sdk
151 install : makedirs tools mmake
152 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.install
154 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
155 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts:
156 @$(NOP)
158 # targets which do not generate files or for which a file/directory exists
159 .PHONY: default all makedirs tools docs clean arch-clean dist-clean install \
160 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts test \
161 kernel workbench rom compiler contrib sdk mmake
163 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
164 test kernel workbench rom compiler contrib :
165 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@
167 # Map MetaTargets to make targets : Call mmake with AROS.target
168 # This does not allow to check for dependancies, so it is not suitable for
169 # Calling standard main targets, but is usable as a shortcut for MetaMake
170 # if it was not installed globally
171 .DEFAULT :
172 @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.$@