r4634@vps: verhaegs | 2007-04-30 20:04:09 -0400
[AROS.git] / Makefile.in
blobb848085ccf5cc6fb1d9fef155e0ca43854186ca9
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 TOP := $(shell pwd)
15 include $(TOP)/config/make.cfg
17 all: makedirs tools mmake
18 @$(CALL) $(MMAKE) AROS.AROS
20 makedirs:
21 @$(RM) $(TOP)/errors
22 @$(FOR) dir in $(AROSDIR) $(GENDIR) $(TOOLDIR) ; do \
23 $(IF) [ ! -d $$dir ]; then \
24 $(MECHO) $(MKDIR) "$$dir" ; \
25 $(MKDIR) "$$dir" ; \
26 else true ; fi ; \
27 done
28 @$(IF) [ ! -f $(AROSDIR)/.gdbinit ]; then \
29 $(CP) $(TOP)/_gdbinit $(AROSDIR)/.gdbinit ; \
30 else true ; fi
32 # Create the tools that are used to build AROS.
33 tools : makedirs $(TOOLLIB) $(GENMF) $(ARCHTOOL) \
34 $(FLEXCAT) $(CREATEDTDESC) $(ILBMTOC) $(ILBMTOICON) \
35 $(COLLECT-AROS) $(AFSLIB) $(COPYTOAFS) \
36 $(FD2INLINE) $(FD2PRAGMA) $(SFDC)
38 $(TOOLLIB) : $(wildcard $(TOP)/tools/toollib/*.[ch])
39 @$(ECHO) Building toollib...
40 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/toollib TOP=$(TOP)
42 $(GENMF) : $(TOP)/tools/genmf/genmf.py
43 @$(ECHO) Copying genmf...
44 @./config.status $(subst $(TOP)/,,$(GENMF)) genmf_executable
46 $(ARCHTOOL) : $(TOP)/tools/archtools/archtool.c
47 @$(ECHO) Building archtool...
48 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/archtools TOP=$(TOP)
50 $(FLEXCAT) : $(TOP)/tools/FlexCat/flexcat.c
51 @$(ECHO) Building flexcat...
52 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/FlexCat TOP=$(TOP)
54 $(CREATEDTDESC) : $(wildcard $(TOP)/tools/dtdesc/*.[ch]) $(wildcard $(TOP)/tools/dtdesc/c_iff/*.[ch])
55 @$(ECHO) Building createdtdesc...
56 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/dtdesc -f Makefile.aros TOP=$(TOP)
58 $(AFSLIB) : $(wildcard $(TOP)/workbench/devs/afs/*.[ch])
59 @$(ECHO) Building afslib...
60 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/copytoafs -f Makefile.afslib TOP=$(TOP)
62 $(COPYTOAFS) : $(TOP)/tools/copytoafs/copytoafs.c
63 @$(ECHO) Building copytoafs...
64 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/copytoafs TOP=$(TOP)
66 $(ILBMTOC) : $(TOP)/tools/ilbmtoc/ilbmtoc.c
67 @$(ECHO) Building ilbmtoc...
68 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/ilbmtoc TOP=$(TOP)
70 $(ILBMTOICON) : $(TOP)/tools/ilbmtoicon/ilbmtoicon.c
71 @$(ECHO) Building ilbmtoicon...
72 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/ilbmtoicon TOP=$(TOP)
74 $(COLLECT-AROS) : $(wildcard $(TOP)/tools/collect-aros/*.[hc])
75 @$(ECHO) Building collect-aros...
76 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/collect-aros TOP=$(TOP)
78 $(FD2INLINE) : $(TOP)/tools/fd2inline/fd2inline.c
79 @$(ECHO) Building fd2inline...
80 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/fd2inline TOP=$(TOP)
82 $(FD2PRAGMA) : $(TOP)/tools/fd2pragma/fd2pragma.c
83 @$(ECHO) Building fd2pragma...
84 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/fd2pragma TOP=$(TOP)
86 $(SFDC) : $(TOP)/tools/sfdc/*.pl
87 @$(ECHO) Building sfdc...
88 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/sfdc TOP=$(TOP)
90 # MetaMake apparently requires a slighty different compilation. Probably
91 # because it is sort-of an external package as well.
93 mmake : $(TOP)/tools/MetaMake/Makefile $(MMAKE)
95 $(TOP)/tools/MetaMake/configure : $(TOP)/tools/MetaMake/configure.in
96 @$(ECHO) Building MetaMake...
97 @cd $(TOP)/tools/MetaMake ; @aros_host_aclocal@ ; @aros_host_autoconf@
99 $(TOP)/tools/MetaMake/Makefile.in : $(TOP)/tools/MetaMake/Makefile.am
100 @cd $(TOP)/tools/MetaMake ; @aros_host_automake@ -a -c
102 $(TOP)/tools/MetaMake/Makefile : $(TOP)/tools/MetaMake/configure \
103 $(TOP)/tools/MetaMake/Makefile.in
104 @cd $(TOP)/tools/MetaMake ; CC="$(HOST_CC)" CFLAGS= ./configure --prefix=$(TOOLDIR)
106 $(MMAKE): $(wildcard $(TOP)/tools/MetaMake/*.[ch]) $(GENMF)
107 @$(MAKE) $(MKARGS) AUTOHEADER=@aros_host_autoheader@ -C $(TOP)/tools/MetaMake
108 @cp $(TOP)/tools/MetaMake/mmake$(HOST_EXE_SUFFIX) $(MMAKE)
110 # Clean the sources
111 clean:
112 @$(CALL) $(MMAKE) AROS.clean
113 -@$(RM) $(ARCHDIR) Makefile mmake.cache config.cache config.status \
114 config.log
116 # Clean the sources and tools
117 arch-clean: clean
118 @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake clean
119 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/FlexCat clean
120 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/archtools clean
121 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/genmf clean
122 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/toollib clean
123 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/genskeleton clean
124 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/dtdesc -f Makefile.aros clean
125 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/collect-aros clean
126 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/fd2inline clean
127 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/fd2pragma clean
128 @$(CALL) $(MAKE) $(MKARGS) -C $(TOP)/tools/sfdc clean
130 # Really clean all - like a clean checkout
131 dist-clean: arch-clean
132 @$(RM) Makefile configure config.* mmake.cache mmake.config
134 # Dependencies don't work with .DEFAULT :-(
135 docs : makedirs tools mmake
136 @$(CALL) $(MMAKE) AROS.docs
138 all-docs : makedirs tools mmake
139 @$(CALL) $(MMAKE) AROS.all-docs
141 sdk : makedirs tools mmake
142 @$(CALL) $(MMAKE) AROS.sdk
144 install : makedirs tools mmake
145 @$(CALL) $(MMAKE) AROS.install
147 # Don't try to generate $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts
148 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts:
149 @$(NOP)
151 # targets which do not generate files or for which a file/directory exists
152 .PHONY: default all makedirs tools docs clean arch-clean dist-clean install \
153 $(TOP)/bin/$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)$(AROS_TARGET_SUFFIX)/gen/config/make.opts test \
154 kernel workbench rom compiler contrib sdk mmake
156 # Workaround for bug in make v3.81 (should normally be handled by .DEFAULT)
157 test kernel workbench rom compiler contrib :
158 @$(CALL) $(MMAKE) AROS.$@
160 # Map MetaTargets to make targets : Call mmake with AROS.target
161 # This does not allow to check for dependancies, so it is not suitable for
162 # Calling standard main targets, but is usable as a shortcut for MetaMake
163 # if it was not installed globally
164 .DEFAULT :
165 @$(CALL) $(MMAKE) AROS.$@