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