Merge changes to benchmarking tool (PR #151)
[helenos.git] / boot / Makefile.common
blob7fd78287feee76d75656fbb4b00c4a711a6f8ce6
2 # Copyright (c) 2006 Martin Decky
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
9 # - Redistributions of source code must retain the above copyright
10 #   notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 #   derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 ## Configuration
32 ROOT_PATH = ..
34 VERSION_DEF = $(ROOT_PATH)/version
36 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
37 COMMON_HEADER = $(ROOT_PATH)/common.h
39 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
40 CONFIG_HEADER = $(ROOT_PATH)/config.h
42 -include $(VERSION_DEF)
43 -include $(COMMON_MAKEFILE)
44 -include $(CONFIG_MAKEFILE)
46 KERNEL_PATH = $(ROOT_PATH)/kernel
47 USPACE_PATH = $(ROOT_PATH)/uspace
48 DIST_PATH = $(USPACE_PATH)/dist
49 DIST_OVERLAY_PATH = $(USPACE_PATH)/overlay
50 TOOLS_PATH = $(ROOT_PATH)/tools
51 DRVS_PATH = drv
53 MKARRAY = $(TOOLS_PATH)/mkarray.py
54 MKFAT = $(TOOLS_PATH)/mkfat.py
55 MKEXT4 = $(TOOLS_PATH)/mkext4.py
56 MKUIMAGE = $(TOOLS_PATH)/mkuimage.py
58 ifeq ($(PRECHECK),y)
59         JOBFILE = $(TOOLS_PATH)/jobfile.py
60         # NOTE: You must not change the order of arguments.
61         CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
62 else
63         CC_JOB = $(CC) $< -o $@
64 endif
66 DISTROOT = distroot
67 INITRD = initrd
69 INIT_TASKS = \
70         $(USPACE_PATH)/srv/ns/ns \
71         $(USPACE_PATH)/srv/loader/loader \
72         $(USPACE_PATH)/app/init/init \
73         $(USPACE_PATH)/srv/locsrv/locsrv \
74         $(USPACE_PATH)/srv/bd/rd/rd \
75         $(USPACE_PATH)/srv/vfs/vfs \
76         $(USPACE_PATH)/srv/logger/logger
78 ifeq ($(RDFMT),tmpfs)
79         INIT_TASKS += $(USPACE_PATH)/srv/fs/tmpfs/tmpfs
80 endif
82 ifeq ($(RDFMT),fat)
83         INIT_TASKS += $(USPACE_PATH)/srv/fs/fat/fat
84 endif
86 ifeq ($(RDFMT),ext4fs)
87         INIT_TASKS += $(USPACE_PATH)/srv/fs/ext4fs/ext4fs
88 endif
90 RD_SRVS_ESSENTIAL = \
91         hid/input \
92         hid/output \
93         hid/console \
94         devman \
95         fs/locfs \
96         klog
98 ifeq ($(CONFIG_FB), y)
99         RD_SRVS_ESSENTIAL += \
100                 hid/compositor
101 endif
103 RD_SRVS_NON_ESSENTIAL = \
104         bd/file_bd \
105         bd/sata_bd \
106         bd/vbd \
107         clipboard \
108         fs/tmpfs \
109         fs/fat \
110         fs/mfs \
111         fs/cdfs \
112         fs/exfat \
113         fs/udf \
114         fs/ext4fs \
115         hid/remcons \
116         hid/isdv4_tablet \
117         hid/rfb \
118         net/dhcp \
119         net/dnsrsrv \
120         net/ethip \
121         net/inetsrv \
122         net/loopip \
123         net/nconfsrv \
124         net/slip \
125         net/tcp \
126         net/udp \
127         taskmon \
128         test/chardev-test \
129         test/ipc-test \
130         volsrv
132 RD_DRVS_ESSENTIAL = \
133         root/root \
134         root/virt \
135         fb/kfb
137 RD_DRVS_NON_ESSENTIAL = \
138         test/test1 \
139         test/test2 \
140         test/test3 \
141         nic/ne2k \
142         nic/e1k \
143         nic/rtl8139 \
144         nic/rtl8169 \
145         nic/ar9271 \
146         nic/virtio-net \
147         block/ahci
149 RD_DRV_CFG =
151 RD_DRVS_FW_NON_ESSENTIAL = \
152         nic/ar9271
154 RD_LIBS =
156 ifeq ($(CONFIG_DEVEL_FILES), y)
157         RD_LIBS += \
158                 $(USPACE_PATH)/lib/c/libc.a
159 endif
161 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)
162         RD_LIBS += \
163                 $(USPACE_PATH)/lib/c/libc.so.0 \
164                 $(USPACE_PATH)/lib/math/libmath.so.0 \
165                 $(USPACE_PATH)/lib/dltest/libdltest.so.0
166 endif
168 RD_APPS_ESSENTIAL = \
169         bdsh \
170         getterm \
171         kio
173 ifeq ($(CONFIG_FB), y)
174         RD_APPS_ESSENTIAL += \
175                 vlaunch \
176                 vterm
177 endif
179 RD_APPS_NON_ESSENTIAL = \
180         barber \
181         bithenge \
182         blkdump \
183         contacts \
184         corecfg \
185         cpptest \
186         devctl \
187         dnscfg \
188         dnsres \
189         download \
190         edit \
191         fdisk \
192         gunzip \
193         hbench \
194         inet \
195         kill \
196         killall \
197         loc \
198         lprint \
199         mixerctl \
200         modplay \
201         logset \
202         mkfat \
203         mkexfat \
204         mkext4 \
205         mkmfs \
206         nic \
207         sbi \
208         sportdmp \
209         redir \
210         taskdump \
211         tester \
212         testread \
213         testrunner \
214         testwrit \
215         tetris \
216         tmon \
217         trace \
218         netecho \
219         nterm \
220         pci \
221         ping \
222         pkg \
223         stats \
224         sysinfo \
225         sysinst \
226         top \
227         untar \
228         usbinfo \
229         vol \
230         vuhid \
231         mkbd \
232         websrv \
233         date \
234         vcalc \
235         vdemo \
236         viewer \
237         df \
238         fontviewer \
239         wifi_supplicant
241 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)
242         RD_APPS_NON_ESSENTIAL += dltest dltests
243 endif
245 RD_TESTS = \
246         $(USPACE_PATH)/lib/c/test-libc \
247         $(USPACE_PATH)/lib/label/test-liblabel \
248         $(USPACE_PATH)/lib/posix/test-libposix \
249         $(USPACE_PATH)/lib/sif/test-libsif \
250         $(USPACE_PATH)/lib/uri/test-liburi \
251         $(USPACE_PATH)/lib/math/test-libmath \
252         $(USPACE_PATH)/drv/bus/usb/xhci/test-xhci \
253         $(USPACE_PATH)/app/bdsh/test-bdsh \
254         $(USPACE_PATH)/srv/net/tcp/test-tcp \
255         $(USPACE_PATH)/srv/volsrv/test-volsrv \
257 RD_DATA_ESSENTIAL = \
258         $(USPACE_PATH)/app/bdsh/demo.txt
260 RD_DATA_NON_ESSENTIAL = \
261         $(USPACE_PATH)/app/modplay/demo.xm \
262         $(USPACE_PATH)/app/viewer/logo.tga
265 COMPONENTS = \
266         $(KERNEL_PATH)/kernel.elf \
267         $(INIT_TASKS) \
268         $(INITRD).img
271 LINK = arch/$(BARCH)/_link.ld
272 COMP = component
273 COMPS = $(COMP)s
275 -include arch/$(BARCH)/Makefile.inc
277 ifeq ($(CONFIG_BAREBONE),y)
278         RD_SRVS = $(RD_SRVS_ESSENTIAL)
279         RD_APPS = $(RD_APPS_ESSENTIAL)
280         RD_DRVS = $(RD_DRVS_ESSENTIAL)
281         RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL)
282         RD_DATA = $(RD_DATA_ESSENTIAL)
283 else
284         RD_SRVS = $(RD_SRVS_ESSENTIAL) $(RD_SRVS_NON_ESSENTIAL)
285         RD_APPS = $(RD_APPS_ESSENTIAL) $(RD_APPS_NON_ESSENTIAL)
286         RD_DRVS = $(RD_DRVS_ESSENTIAL) $(RD_DRVS_NON_ESSENTIAL)
287         RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL) $(RD_DRVS_FW_NON_ESSENTIAL)
288         RD_DATA = $(RD_DATA_ESSENTIAL) $(RD_DATA_NON_ESSENTIAL)
289 endif
291 MODULES := $(notdir $(COMPONENTS))
293 BOOT_OUTPUT ?= $(ROOT_PATH)/image.boot
294 RAW ?= image.raw
295 JOB ?= image.job
296 MAP ?= image.map
297 BUILD ?= Makefile.build