1 # Copyright © 2000-2003, 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, this variable should go in mmake.config/globalvarfile
15 export AROS_TARGET_BOOTLOADER
:= @aros_target_bootloader@
18 include $(TOP
)/config
/make.cfg
20 all: makedirs tools mmake
21 @
$(CALL
) $(MMAKE
) AROS.AROS
25 @
$(FOR
) dir in
$(AROSDIR
) $(GENDIR
) $(TOOLDIR
) ; do \
26 $(IF
) [ ! -d
$$dir ]; then \
27 $(MECHO
) $(MKDIR
) "$$dir" ; \
31 @
$(IF
) [ ! -f
$(AROSDIR
)/.gdbinit
]; then \
32 $(CP
) $(TOP
)/_gdbinit
$(AROSDIR
)/.gdbinit
; \
35 # Create the tools that are used to build AROS.
36 tools
: makedirs
$(TOOLLIB
) $(GENMF
) $(ARCHTOOL
) \
37 $(FLEXCAT
) $(CREATEDTDESC
) $(ILBMTOC
) $(ILBMTOICON
) \
38 $(COLLECT-AROS
) $(AFSLIB
) $(COPYTOAFS
) \
39 $(FD2INLINE
) $(FD2PRAGMA
) $(SFDC
)
41 $(TOOLLIB
) : $(wildcard $(TOP
)/tools
/toollib
/*.
[ch
])
42 @
$(ECHO
) Building toollib...
43 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/toollib TOP
=$(TOP
)
45 $(GENMF
) : $(TOP
)/tools
/genmf
/genmf.py
46 @
$(ECHO
) Copying genmf...
47 @.
/config.status
$(subst $(TOP
)/,,$(GENMF
)) genmf_executable
49 $(ARCHTOOL
) : $(TOP
)/tools
/archtools
/archtool.c
50 @
$(ECHO
) Building archtool...
51 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/archtools TOP
=$(TOP
)
53 $(FLEXCAT
) : $(TOP
)/tools
/FlexCat
/flexcat.c
54 @
$(ECHO
) Building flexcat...
55 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/FlexCat TOP
=$(TOP
)
57 $(CREATEDTDESC
) : $(wildcard $(TOP
)/tools
/dtdesc
/*.
[ch
]) $(wildcard $(TOP
)/tools
/dtdesc
/c_iff
/*.
[ch
])
58 @
$(ECHO
) Building createdtdesc...
59 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/dtdesc
-f Makefile.aros TOP
=$(TOP
)
61 $(AFSLIB
) : $(wildcard $(TOP
)/workbench
/devs
/afs
/*.
[ch
])
62 @
$(ECHO
) Building afslib...
63 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/copytoafs
-f Makefile.afslib TOP
=$(TOP
)
65 $(COPYTOAFS
) : $(TOP
)/tools
/copytoafs
/copytoafs.c
66 @
$(ECHO
) Building copytoafs...
67 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/copytoafs TOP
=$(TOP
)
69 $(ILBMTOC
) : $(TOP
)/tools
/ilbmtoc
/ilbmtoc.c
70 @
$(ECHO
) Building ilbmtoc...
71 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/ilbmtoc TOP
=$(TOP
)
73 $(ILBMTOICON
) : $(TOP
)/tools
/ilbmtoicon
/ilbmtoicon.c
74 @
$(ECHO
) Building ilbmtoicon...
75 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/ilbmtoicon TOP
=$(TOP
)
77 $(COLLECT-AROS
) : $(wildcard $(TOP
)/tools
/collect-aros
/*.
[hc
])
78 @
$(ECHO
) Building collect-aros...
79 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/collect-aros TOP
=$(TOP
)
81 $(FD2INLINE
) : $(TOP
)/tools
/fd2inline
/fd2inline.c
82 @
$(ECHO
) Building fd2inline...
83 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2inline TOP
=$(TOP
)
85 $(FD2PRAGMA
) : $(TOP
)/tools
/fd2pragma
/fd2pragma.c
86 @
$(ECHO
) Building fd2pragma...
87 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2pragma TOP
=$(TOP
)
89 $(SFDC
) : $(TOP
)/tools
/sfdc
/*.pl
90 @
$(ECHO
) Building sfdc...
91 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/sfdc TOP
=$(TOP
)
93 # MetaMake apparently requires a slighty different compilation. Probably
94 # because it is sort-of an external package as well.
96 mmake
: $(TOP
)/tools
/MetaMake
/Makefile
$(MMAKE
)
98 $(TOP
)/tools
/MetaMake
/configure
: $(TOP
)/tools
/MetaMake
/configure.in
99 @
$(ECHO
) Building MetaMake...
100 @cd
$(TOP
)/tools
/MetaMake
; @aros_host_aclocal@
; @aros_host_autoconf@
102 $(TOP
)/tools
/MetaMake
/Makefile.in
: $(TOP
)/tools
/MetaMake
/Makefile.am
103 @cd
$(TOP
)/tools
/MetaMake
; @aros_host_automake@
-a
-c
105 $(TOP
)/tools
/MetaMake
/Makefile
: $(TOP
)/tools
/MetaMake
/configure \
106 $(TOP
)/tools
/MetaMake
/Makefile.in
107 @cd
$(TOP
)/tools
/MetaMake
; CC
="$(HOST_CC)" CFLAGS
= .
/configure
--prefix=$(TOOLDIR
)
109 $(MMAKE
): $(wildcard $(TOP
)/tools
/MetaMake
/*.
[ch
]) $(GENMF
)
110 @
$(MAKE
) $(MKARGS
) AUTOHEADER
=@aros_host_autoheader@
-C
$(TOP
)/tools
/MetaMake
111 @cp
$(TOP
)/tools
/MetaMake
/mmake
$(HOST_EXE_SUFFIX
) $(MMAKE
)
115 @
$(CALL
) $(MMAKE
) AROS.
clean
116 -@
$(RM
) $(ARCHDIR
) Makefile mmake.cache config.cache config.status \
119 # Clean the sources and tools
121 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
clean
122 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/FlexCat
clean
123 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/archtools
clean
124 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/genmf
clean
125 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/toollib
clean
126 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/genskeleton
clean
127 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/dtdesc
-f Makefile.aros
clean
128 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/collect-aros
clean
129 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2inline
clean
130 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2pragma
clean
131 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/sfdc
clean
133 # Really clean all - like a clean checkout
134 dist-clean
: arch-clean
135 @
$(RM
) Makefile configure config.
* mmake.cache mmake.config
137 # Dependencies don't work with .DEFAULT :-(
138 docs
: makedirs tools mmake
139 @
$(CALL
) $(MMAKE
) AROS.docs
141 all-docs
: makedirs tools mmake
142 @
$(CALL
) $(MMAKE
) AROS.all-docs
144 sdk
: makedirs tools mmake
145 @
$(CALL
) $(MMAKE
) AROS.sdk
147 install : makedirs tools mmake
148 @
$(CALL
) $(MMAKE
) AROS.
install
150 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
151 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts
:
154 # targets which do not generate files or for which a file/directory exists
155 .PHONY
: default
all makedirs tools docs
clean arch-clean dist-clean
install \
156 $(TOP
)/bin
/$(AROS_TARGET_ARCH
)-$(AROS_TARGET_CPU
)$(AROS_TARGET_SUFFIX
)/gen
/config
/make.opts
test \
157 kernel workbench rom compiler contrib sdk mmake
159 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
160 test kernel workbench rom compiler contrib
:
161 @
$(CALL
) $(MMAKE
) AROS.
$@
163 # Map MetaTargets to make targets : Call mmake with AROS.target
164 # This does not allow to check for dependancies, so it is not suitable for
165 # Calling standard main targets, but is usable as a shortcut for MetaMake
166 # if it was not installed globally
168 @
$(CALL
) $(MMAKE
) AROS.
$@