1 # Copyright © 2000-2011, 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_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@
21 include $(TOP
)/config
/make.cfg
23 MMAKE_OPTIONS ?
= --srcdir=$(SRCDIR
) --builddir
=$(TOP
)
24 ifneq (,$(findstring s
,$(MAKEFLAGS
)))
28 all: makedirs tools mmake
29 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.AROS
33 @
$(FOR
) dir in
$(AROSDIR
) $(GENDIR
) $(TOOLDIR
) ; do \
34 $(IF
) [ ! -d
$$dir ]; then \
35 $(MECHO
) $(MKDIR
) "$$dir" ; \
39 @
$(IF
) [ ! -f
$(AROSDIR
)/.gdbinit
]; then \
40 $(CP
) $(SRCDIR
)/_gdbinit
$(AROSDIR
)/.gdbinit
; \
43 # Create the tools that are used to build AROS.
44 tools
: makedirs
$(TOOLLIB
) $(GENMF
) $(ARCHTOOL
) \
45 $(FLEXCAT
) $(CREATEDTDESC
) $(ILBMTOC
) $(ILBMTOICON
) \
46 $(COLLECT-AROS
) $(AFSLIB
) $(COPYTOAFS
) \
47 $(FD2INLINE
) $(FD2PRAGMA
) $(SFDC
)
49 $(TOOLLIB
) : $(wildcard $(SRCDIR
)/tools
/toollib
/*.
[ch
])
50 @
$(ECHO
) Building toollib...
51 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/toollib SRCDIR
=$(SRCDIR
) TOP
=$(TOP
) CURDIR
=toollib
53 $(GENMF
) : $(SRCDIR
)/tools
/genmf
/genmf.py
54 @
$(ECHO
) Copying genmf...
55 @.
/config.status
$(subst $(TOP
)/,,$(GENMF
)) genmf_executable
57 $(ARCHTOOL
) : $(SRCDIR
)/tools
/archtools
/archtool.c
58 @
$(ECHO
) Building archtool...
59 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/archtools SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
61 $(FLEXCAT
) : $(SRCDIR
)/tools
/FlexCat
/flexcat.c
62 @
$(ECHO
) Building flexcat...
63 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/FlexCat SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
65 $(CREATEDTDESC
) : $(wildcard $(SRCDIR
)/tools
/dtdesc
/*.
[ch
]) $(wildcard $(SRCDIR
)/tools
/dtdesc
/c_iff
/*.
[ch
])
66 @
$(ECHO
) Building createdtdesc...
67 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/dtdesc
-f Makefile.aros SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
69 $(AFSLIB
) : $(wildcard $(SRCDIR
)/workbench
/devs
/afs
/*.
[ch
])
70 @
$(ECHO
) Building afslib...
71 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/copytoafs
-f Makefile.afslib SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
73 $(COPYTOAFS
) : $(AFSLIB
) $(SRCDIR
)/tools
/copytoafs
/copytoafs.c
74 @
$(ECHO
) Building copytoafs...
75 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/copytoafs SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
77 $(ILBMTOC
) : $(SRCDIR
)/tools
/ilbmtoc
/ilbmtoc.c
78 @
$(ECHO
) Building ilbmtoc...
79 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/ilbmtoc SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
81 $(ILBMTOICON
) : $(SRCDIR
)/tools
/ilbmtoicon
/ilbmtoicon.c
82 @
$(ECHO
) Building ilbmtoicon...
83 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/ilbmtoicon SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
85 $(COLLECT-AROS
) : $(wildcard $(SRCDIR
)/tools
/collect-aros
/*.
[hc
])
86 @
$(ECHO
) Building collect-aros...
87 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/collect-aros SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
89 $(FD2INLINE
) : $(SRCDIR
)/tools
/fd2inline
/fd2inline.c
90 @
$(ECHO
) Building fd2inline...
91 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2inline SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
93 $(FD2PRAGMA
) : $(SRCDIR
)/tools
/fd2pragma
/fd2pragma.c
94 @
$(ECHO
) Building fd2pragma...
95 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2pragma SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
97 $(SFDC
) : $(SRCDIR
)/tools
/sfdc
/*.pl
98 @
$(ECHO
) Building sfdc...
99 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/sfdc SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
101 # MetaMake apparently requires a slighty different compilation. Probably
102 # because it is sort-of an external package as well.
104 mmake
: $(TOP
)/tools
/MetaMake
/Makefile
$(MMAKE
)
106 $(SRCDIR
)/tools
/MetaMake
/configure
: $(SRCDIR
)/tools
/MetaMake
/configure.in
107 @
$(ECHO
) Building MetaMake...
108 @cd
$(SRCDIR
)/tools
/MetaMake
&& @aros_host_aclocal@
&& @aros_host_autoconf@
110 $(TOP
)/tools
/MetaMake
/Makefile
: $(SRCDIR
)/tools
/MetaMake
/configure
$(SRCDIR
)/tools
/MetaMake
/Makefile.in
111 @
$(IF
) [ ! -d
$(TOP
)/tools
/MetaMake
]; then \
112 $(MECHO
) $(MKDIR
) "$(TOP)/tools/MetaMake" ; \
113 $(MKDIR
) "$(TOP)/tools/MetaMake"; \
115 @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
117 $(MMAKE
): $(TOP
)/tools
/MetaMake
/Makefile
$(wildcard $(SRCDIR
)/tools
/MetaMake
/*.
[ch
]) $(GENMF
)
118 @
$(MAKE
) $(MKARGS
) AUTOHEADER
=@aros_host_autoheader@
-C
$(TOP
)/tools
/MetaMake
119 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
install
121 # Clean the sources and tools
123 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
clean
124 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
125 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/FlexCat
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
126 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/archtools
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
127 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/genmf
clean
128 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/toollib
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
129 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/dtdesc
-f Makefile.aros
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
130 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/collect-aros
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
131 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2inline
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
132 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/fd2pragma
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
133 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(SRCDIR
)/tools
/sfdc
clean SRCDIR
=$(SRCDIR
) TOP
=$(TOP
)
134 -@
$(RM
) $(ARCHDIR
) Makefile config.cache config.status config.log \
135 mmake.cache mmake.config rom
/mmakefile config
/make.cfg \
136 $(AROS_DEVELOPMENT
)/include/aros
/config.h \
137 $(GENDIR
)/include/aros
/config.h
$(HOSTGENDIR
)/config
/host.cfg \
138 $(GENDIR
)/config
/target.cfg
$(GENDIR
)/config
/make.defaults \
139 $(GENDIR
)/config
/specs \
140 $(TOOLDIR
)/$(AROS_TARGET_CPU
)-$(AROS_TARGET_ARCH
)$(AROS_TARGET_SUFFIX
)-aros-gcc \
141 $(TOOLDIR
)/$(AROS_TARGET_CPU
)-$(AROS_TARGET_ARCH
)$(AROS_TARGET_SUFFIX
)-aros-ld \
142 $(GENDIR
)/scripts
/genshared
$(TOOLDIR
)/genmf.py \
143 tools
/adflib
/myconf.aros tools
/collect-aros
/env.h
145 # Clean the sources and tools
149 # Really clean all - like a clean checkout
150 dist-clean
: arch-clean
153 # Dependencies don't work with .DEFAULT :-(
154 docs
: makedirs tools mmake
155 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.docs
157 all-docs
: makedirs tools mmake
158 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.all-docs
160 sdk
: makedirs tools mmake
161 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.sdk
163 install : makedirs tools mmake
164 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
install
166 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
167 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts
:
170 # targets which do not generate files or for which a file/directory exists
171 .PHONY
: default
all makedirs tools docs
clean arch-clean dist-clean
install \
172 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts
test \
173 kernel workbench rom compiler contrib sdk mmake
175 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
176 test kernel workbench rom compiler contrib
:
177 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@
179 # Map MetaTargets to make targets : Call mmake with AROS.target
180 # This does not allow to check for dependancies, so it is not suitable for
181 # Calling standard main targets, but is usable as a shortcut for MetaMake
182 # if it was not installed globally
184 @
+$(CALL
) $(MMAKE
) $(MMAKE_OPTIONS
) AROS.
$@