2 # Copyright (c) 2006 Martin Decky
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
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.
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
53 MKARRAY = $(TOOLS_PATH)/mkarray.py
54 MKFAT = $(TOOLS_PATH)/mkfat.py
55 MKEXT4 = $(TOOLS_PATH)/mkext4.py
56 MKUIMAGE = $(TOOLS_PATH)/mkuimage.py
59 JOBFILE = $(TOOLS_PATH)/jobfile.py
60 # NOTE: You must not change the order of arguments.
61 CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
63 CC_JOB = $(CC) $< -o $@
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
79 INIT_TASKS += $(USPACE_PATH)/srv/fs/tmpfs/tmpfs
83 INIT_TASKS += $(USPACE_PATH)/srv/fs/fat/fat
86 ifeq ($(RDFMT),ext4fs)
87 INIT_TASKS += $(USPACE_PATH)/srv/fs/ext4fs/ext4fs
98 ifeq ($(CONFIG_FB), y)
99 RD_SRVS_ESSENTIAL += \
103 RD_SRVS_NON_ESSENTIAL = \
132 RD_DRVS_ESSENTIAL = \
137 RD_DRVS_NON_ESSENTIAL = \
151 RD_DRVS_FW_NON_ESSENTIAL = \
156 ifeq ($(CONFIG_DEVEL_FILES), y)
158 $(USPACE_PATH)/lib/c/libc.a
161 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)
163 $(USPACE_PATH)/lib/c/libc.so.0 \
164 $(USPACE_PATH)/lib/math/libmath.so.0 \
165 $(USPACE_PATH)/lib/dltest/libdltest.so.0
168 RD_APPS_ESSENTIAL = \
173 ifeq ($(CONFIG_FB), y)
174 RD_APPS_ESSENTIAL += \
179 RD_APPS_NON_ESSENTIAL = \
241 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)
242 RD_APPS_NON_ESSENTIAL += dltest dltests
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
266 $(KERNEL_PATH)/kernel.elf \
271 LINK = arch/$(BARCH)/_link.ld
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)
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)
291 MODULES := $(notdir $(COMPONENTS))
293 BOOT_OUTPUT ?= $(ROOT_PATH)/image.boot
297 BUILD ?= Makefile.build