1 # Copyright © 2000-2016, The AROS Development Team. All rights reserved.
4 # Main makefile for AROS
8 AROS_HOST_CPU ?
= @aros_host_cpu@
9 AROS_HOST_ARCH ?
= @aros_host_arch@
10 AROS_TARGET_CPU ?
= @aros_target_cpu@
11 AROS_TARGET_CPU_MODE ?
= @aros_target_cpu_mode@
12 AROS_TARGET_ARCH ?
= @aros_target_arch@
13 AROS_TARGET_VARIANT ?
= @aros_target_variant@
15 # normally, these variable's should go in mmake.config/globalvarfile
16 export AROS_TARGET_BOOTLOADER
:= @aros_target_bootloader@
17 export AROS_TARGET_ICONSET
:= @aros_target_iconset@
18 export AROS_GUI_THEME
:= @aros_target_guitheme@
20 TOP
:= @AROS_BUILDDIR@
22 include $(TOP
)/config
/make.cfg
24 MMAKE_OPTIONS ?
= --srcdir=$(SRCDIR
) --builddir
=$(TOP
)
25 ifneq (,$(findstring s
,$(MAKEFLAGS
)))
30 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.AROS
34 @
$(FOR
) dir in
$(AROSDIR
) $(GENDIR
) $(TOOLDIR
) ; do \
35 $(IF
) [ ! -d
$$dir ]; then \
36 $(MECHO
) $(MKDIR
) "$$dir" ; \
40 @
$(IF
) [ ! -f
$(AROSDIR
)/.gdbinit
]; then \
41 $(CP
) $(SRCDIR
)/_gdbinit
$(AROSDIR
)/.gdbinit
; \
44 # Create the tools that are used to build AROS.
45 tools
: makedirs mmake
$(TOOLLIB
) $(GENMF
) $(ARCHTOOL
) $(ELF2HUNK
) \
46 $(FLEXCAT
) $(CREATEDTDESC
) \
47 $(ILBMTOC
) $(ILBMTOICON
) $(INFOINFO
) \
48 $(COLLECT-AROS
) $(AFSLIB
) $(COPYTOAFS
) \
49 $(FD2INLINE
) $(FD2PRAGMA
) $(SFDC
) $(SETREV
)
52 ifneq ($(CROSSTOOLS_TARGET
),)
53 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$(CROSSTOOLS_TARGET
)
58 $(TOOLLIB
) : $(wildcard $(SRCDIR
)/tools
/toollib
/*.
[ch
])
59 @
$(ECHO
) Building toollib...
60 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/toollib SRCDIR
=$(SRCDIR
) TOP
=$(TOP
) CURDIR
=toollib
62 $(GENMF
) : $(SRCDIR
)/tools
/genmf
/genmf.py
63 @
$(ECHO
) Copying genmf...
64 @.
/config.status
$(subst $(TOP
)/,,$(GENMF
)) genmf_executable
66 $(ELF2HUNK
) : $(SRCDIR
)/tools
/elf2hunk
/elf2hunk.c
67 @
$(ECHO
) Building elf2hunk...
68 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/elf2hunk SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
70 $(ARCHTOOL
) : $(SRCDIR
)/tools
/archtools
/archtool.c
71 @
$(ECHO
) Building archtool...
72 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/archtools SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
74 $(FLEXCAT
) : $(wildcard $(SRCDIR
)/tools
/flexcat
/src
/*.
[ch
]) $(wildcard $(SRCDIR
)/tools
/flexcat
/src
/sd
/*.sd
)
75 @
$(ECHO
) Building flexcat...
76 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/flexcat
/src
-f Makefile.aros SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
78 $(CREATEDTDESC
) : $(wildcard $(SRCDIR
)/tools
/dtdesc
/*.
[ch
]) $(wildcard $(SRCDIR
)/tools
/dtdesc
/c_iff
/*.
[ch
])
79 @
$(ECHO
) Building createdtdesc...
80 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/dtdesc
-f Makefile.aros SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
82 $(AFSLIB
) : $(wildcard $(SRCDIR
)/workbench
/devs
/afs
/*.
[ch
])
83 @
$(ECHO
) Building afslib...
84 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/copytoafs
-f Makefile.afslib SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
86 $(COPYTOAFS
) : $(AFSLIB
) $(SRCDIR
)/tools
/copytoafs
/copytoafs.c
87 @
$(ECHO
) Building copytoafs...
88 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/copytoafs SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
90 $(ILBMTOC
) : $(SRCDIR
)/tools
/ilbmtoc
/ilbmtoc.c
91 @
$(ECHO
) Building ilbmtoc...
92 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/ilbmtoc SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
94 $(ILBMTOICON
) : $(SRCDIR
)/tools
/ilbmtoicon
/ilbmtoicon.c
95 @
$(ECHO
) Building ilbmtoicon...
96 @
$(CALL
) $(MAKE
) $(MKARGS
) $@
-C
$(SRCDIR
)/tools
/ilbmtoicon SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
98 $(INFOINFO
) : $(SRCDIR
)/tools
/ilbmtoicon
/infoinfo.c
99 @
$(ECHO
) Building infoinfo...
100 @
$(CALL
) $(MAKE
) $(MKARGS
) $@
-C
$(SRCDIR
)/tools
/ilbmtoicon SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
102 $(COLLECT-AROS
) : $(wildcard $(SRCDIR
)/tools
/collect-aros
/*.
[hc
])
103 @
$(ECHO
) Building collect-aros...
104 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/collect-aros SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
106 $(FD2INLINE
) : $(SRCDIR
)/tools
/fd2inline
/fd2inline.c
107 @
$(ECHO
) Building fd2inline...
108 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2inline SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
110 $(FD2PRAGMA
) : $(SRCDIR
)/tools
/fd2pragma
/fd2pragma.c
111 @
$(ECHO
) Building fd2pragma...
112 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2pragma SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
114 $(SFDC
) : $(SRCDIR
)/tools
/sfdc
/*.pl
115 @
$(ECHO
) Building sfdc...
116 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/sfdc SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
118 $(SETREV
) : $(SRCDIR
)/tools
/setrev
/setrev.c
119 @
$(ECHO
) Building setrev...
120 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/setrev SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
122 # MetaMake apparently requires a slighty different compilation. Probably
123 # because it is sort-of an external package as well.
125 mmake
: $(TOP
)/tools
/MetaMake
/Makefile
$(MMAKE
)
127 $(SRCDIR
)/tools
/MetaMake
/configure
: $(SRCDIR
)/tools
/MetaMake
/configure.in
128 @
$(ECHO
) Building MetaMake...
129 @cd
$(SRCDIR
)/tools
/MetaMake
&& @aros_host_aclocal@
&& @aros_host_autoconf@
131 $(TOP
)/tools
/MetaMake
/Makefile
: $(SRCDIR
)/tools
/MetaMake
/configure
$(SRCDIR
)/tools
/MetaMake
/Makefile.in
132 @
$(IF
) [ ! -d
$(TOP
)/tools
/MetaMake
]; then \
133 $(MECHO
) $(MKDIR
) "$(TOP)/tools/MetaMake" ; \
134 $(MKDIR
) "$(TOP)/tools/MetaMake"; \
136 @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
138 $(MMAKE
): $(TOP
)/tools
/MetaMake
/Makefile
$(wildcard $(SRCDIR
)/tools
/MetaMake
/*.
[ch
]) $(GENMF
)
139 @
$(MAKE
) $(MKARGS
) AUTOHEADER
=@aros_host_autoheader@
-C
$(TOP
)/tools
/MetaMake
140 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
install
142 # Clean the sources and tools
144 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
clean
145 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
146 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/flexcat
/src
-f Makefile.aros
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
147 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/archtools
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
148 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/genmf
clean
149 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/toollib
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
150 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/dtdesc
-f Makefile.aros
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
151 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/collect-aros
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
152 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2inline
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
153 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2pragma
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
154 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/sfdc
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
155 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/setrev
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
156 -@
$(RM
) $(ARCHDIR
) Makefile config.cache config.status config.log \
157 mmake.cache mmake.config rom
/mmakefile config
/make.cfg \
158 $(AROS_DEVELOPMENT
)/include/aros
/config.h \
159 $(GENDIR
)/include/aros
/config.h
$(HOSTGENDIR
)/config
/host.cfg \
160 $(GENDIR
)/config
/target.cfg
$(GENDIR
)/config
/make.defaults \
161 $(GENDIR
)/config
/specs \
162 $(TOOLDIR
)/$(AROS_TARGET_CPU
)-$(AROS_TARGET_ARCH
)$(AROS_TARGET_SUFFIX
)-aros-gcc \
163 $(TOOLDIR
)/$(AROS_TARGET_CPU
)-$(AROS_TARGET_ARCH
)$(AROS_TARGET_SUFFIX
)-aros-ld \
164 $(GENDIR
)/scripts
/genshared
$(TOOLDIR
)/genmf.py \
165 tools
/adflib
/myconf.aros tools
/collect-aros
/env.h
167 # Clean the sources and tools
171 # Really clean all - like a clean checkout
172 dist-clean
: arch-clean
175 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
176 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts
:
179 # targets which do not generate files or for which a file/directory exists
180 .PHONY
: default
all makedirs tools crosstools docs
clean arch-clean dist-clean
install \
181 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts \
182 test kernel boot workbench compiler contrib ports sdk mmake query
184 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
185 install test kernel boot workbench compiler contrib ports sdk
: crosstools
186 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@
188 # Bypass crosstools target.
190 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@
192 # Map MetaTargets to make targets : Call mmake with AROS.target
193 # This does not allow to check for dependancies, so it is not suitable for
194 # Calling standard main targets, but is usable as a shortcut for MetaMake
195 # if it was not installed globally
199 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@
201 # The '%-quick' and '%-clean' targets are special - we don't want to wait around
202 # for building crosstools if we just want to build one subtarget
204 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@
207 @
$(MAKE
) $(MKARGS
) crosstools
208 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@