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, these variable's should go in mmake.config/globalvarfile
15 export AROS_TARGET_BOOTLOADER
:= @aros_target_bootloader@
16 export AROS_GUI_THEME
:= @aros_target_guitheme@
19 include $(TOP
)/config
/make.cfg
21 all: makedirs tools mmake
22 @
$(CALL
) $(MMAKE
) AROS.AROS
26 @
$(FOR
) dir in
$(AROSDIR
) $(GENDIR
) $(TOOLDIR
) ; do \
27 $(IF
) [ ! -d
$$dir ]; then \
28 $(MECHO
) $(MKDIR
) "$$dir" ; \
32 @
$(IF
) [ ! -f
$(AROSDIR
)/.gdbinit
]; then \
33 $(CP
) $(TOP
)/_gdbinit
$(AROSDIR
)/.gdbinit
; \
36 # Create the tools that are used to build AROS.
37 tools
: makedirs
$(TOOLLIB
) $(GENMF
) $(ARCHTOOL
) \
38 $(FLEXCAT
) $(CREATEDTDESC
) $(ILBMTOC
) $(ILBMTOICON
) \
39 $(COLLECT-AROS
) $(AFSLIB
) $(COPYTOAFS
) \
40 $(FD2INLINE
) $(FD2PRAGMA
) $(SFDC
)
42 $(TOOLLIB
) : $(wildcard $(TOP
)/tools
/toollib
/*.
[ch
])
43 @
$(ECHO
) Building toollib...
44 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/toollib TOP
=$(TOP
)
46 $(GENMF
) : $(TOP
)/tools
/genmf
/genmf.py
47 @
$(ECHO
) Copying genmf...
48 @.
/config.status
$(subst $(TOP
)/,,$(GENMF
)) genmf_executable
50 $(ARCHTOOL
) : $(TOP
)/tools
/archtools
/archtool.c
51 @
$(ECHO
) Building archtool...
52 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/archtools TOP
=$(TOP
)
54 $(FLEXCAT
) : $(TOP
)/tools
/FlexCat
/flexcat.c
55 @
$(ECHO
) Building flexcat...
56 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/FlexCat TOP
=$(TOP
)
58 $(CREATEDTDESC
) : $(wildcard $(TOP
)/tools
/dtdesc
/*.
[ch
]) $(wildcard $(TOP
)/tools
/dtdesc
/c_iff
/*.
[ch
])
59 @
$(ECHO
) Building createdtdesc...
60 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/dtdesc
-f Makefile.aros TOP
=$(TOP
)
62 $(AFSLIB
) : $(wildcard $(TOP
)/workbench
/devs
/afs
/*.
[ch
])
63 @
$(ECHO
) Building afslib...
64 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/copytoafs
-f Makefile.afslib TOP
=$(TOP
)
66 $(COPYTOAFS
) : $(TOP
)/tools
/copytoafs
/copytoafs.c
67 @
$(ECHO
) Building copytoafs...
68 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/copytoafs TOP
=$(TOP
)
70 $(ILBMTOC
) : $(TOP
)/tools
/ilbmtoc
/ilbmtoc.c
71 @
$(ECHO
) Building ilbmtoc...
72 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/ilbmtoc TOP
=$(TOP
)
74 $(ILBMTOICON
) : $(TOP
)/tools
/ilbmtoicon
/ilbmtoicon.c
75 @
$(ECHO
) Building ilbmtoicon...
76 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/ilbmtoicon TOP
=$(TOP
)
78 $(COLLECT-AROS
) : $(wildcard $(TOP
)/tools
/collect-aros
/*.
[hc
])
79 @
$(ECHO
) Building collect-aros...
80 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/collect-aros TOP
=$(TOP
)
82 $(FD2INLINE
) : $(TOP
)/tools
/fd2inline
/fd2inline.c
83 @
$(ECHO
) Building fd2inline...
84 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2inline TOP
=$(TOP
)
86 $(FD2PRAGMA
) : $(TOP
)/tools
/fd2pragma
/fd2pragma.c
87 @
$(ECHO
) Building fd2pragma...
88 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2pragma TOP
=$(TOP
)
90 $(SFDC
) : $(TOP
)/tools
/sfdc
/*.pl
91 @
$(ECHO
) Building sfdc...
92 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/sfdc TOP
=$(TOP
)
94 # MetaMake apparently requires a slighty different compilation. Probably
95 # because it is sort-of an external package as well.
97 mmake
: $(TOP
)/tools
/MetaMake
/Makefile
$(MMAKE
)
99 $(TOP
)/tools
/MetaMake
/configure
: $(TOP
)/tools
/MetaMake
/configure.in
100 @
$(ECHO
) Building MetaMake...
101 @cd
$(TOP
)/tools
/MetaMake
; @aros_host_aclocal@
; @aros_host_autoconf@
103 $(TOP
)/tools
/MetaMake
/Makefile.in
: $(TOP
)/tools
/MetaMake
/Makefile.am
104 @cd
$(TOP
)/tools
/MetaMake
; @aros_host_automake@
-a
-c
106 $(TOP
)/tools
/MetaMake
/Makefile
: $(TOP
)/tools
/MetaMake
/configure \
107 $(TOP
)/tools
/MetaMake
/Makefile.in
108 @cd
$(TOP
)/tools
/MetaMake
; CC
="$(HOST_CC)" CFLAGS
= .
/configure
--prefix=$(TOOLDIR
)
110 $(MMAKE
): $(wildcard $(TOP
)/tools
/MetaMake
/*.
[ch
]) $(GENMF
)
111 @
$(MAKE
) $(MKARGS
) AUTOHEADER
=@aros_host_autoheader@
-C
$(TOP
)/tools
/MetaMake
112 @cp
$(TOP
)/tools
/MetaMake
/mmake
$(HOST_EXE_SUFFIX
) $(MMAKE
)
116 @
$(CALL
) $(MMAKE
) AROS.
clean
117 -@
$(RM
) $(ARCHDIR
) Makefile mmake.cache config.cache config.status \
120 # Clean the sources and tools
122 @
$(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/MetaMake
clean
123 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/FlexCat
clean TOP
=$(TOP
)
124 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/archtools
clean TOP
=$(TOP
)
125 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/genmf
clean
126 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/toollib
clean TOP
=$(TOP
)
127 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/dtdesc
-f Makefile.aros
clean TOP
=$(TOP
)
128 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/collect-aros
clean TOP
=$(TOP
)
129 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2inline
clean TOP
=$(TOP
)
130 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/fd2pragma
clean TOP
=$(TOP
)
131 @
$(CALL
) $(MAKE
) $(MKARGS
) -C
$(TOP
)/tools
/sfdc
clean TOP
=$(TOP
)
133 # Really clean all - like a clean checkout
134 dist-clean
: arch-clean
135 @
$(RM
) Makefile 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.
$@