| 1 | #
|
|---|
| 2 | # Copyright (c) 2006 Martin Decky
|
|---|
| 3 | # All rights reserved.
|
|---|
| 4 | #
|
|---|
| 5 | # Redistribution and use in source and binary forms, with or without
|
|---|
| 6 | # modification, are permitted provided that the following conditions
|
|---|
| 7 | # are met:
|
|---|
| 8 | #
|
|---|
| 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.
|
|---|
| 16 | #
|
|---|
| 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.
|
|---|
| 27 | #
|
|---|
| 28 |
|
|---|
| 29 | ## Configuration
|
|---|
| 30 | #
|
|---|
| 31 |
|
|---|
| 32 | ROOT_PATH = ..
|
|---|
| 33 |
|
|---|
| 34 | VERSION_DEF = $(ROOT_PATH)/version
|
|---|
| 35 |
|
|---|
| 36 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
|---|
| 37 |
|
|---|
| 38 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
|---|
| 39 | CONFIG_HEADER = $(ROOT_PATH)/config.h
|
|---|
| 40 |
|
|---|
| 41 | -include $(VERSION_DEF)
|
|---|
| 42 | -include $(COMMON_MAKEFILE)
|
|---|
| 43 | -include $(CONFIG_MAKEFILE)
|
|---|
| 44 |
|
|---|
| 45 | USPACE_PATH = $(ROOT_PATH)/uspace
|
|---|
| 46 | DIST_PATH = $(ROOT_PATH)/dist
|
|---|
| 47 | DIST_OVERLAY_PATH = $(USPACE_PATH)/overlay
|
|---|
| 48 | TOOLS_PATH = $(ROOT_PATH)/tools
|
|---|
| 49 | DRVS_PATH = drv
|
|---|
| 50 |
|
|---|
| 51 | MKARRAY = $(TOOLS_PATH)/mkarray.py
|
|---|
| 52 | MKFAT = $(TOOLS_PATH)/mkfat.py
|
|---|
| 53 | MKEXT4 = $(TOOLS_PATH)/mkext4.py
|
|---|
| 54 | MKUIMAGE = $(TOOLS_PATH)/mkuimage.py
|
|---|
| 55 |
|
|---|
| 56 | ifeq ($(PRECHECK),y)
|
|---|
| 57 | JOBFILE = $(TOOLS_PATH)/jobfile.py
|
|---|
| 58 | # NOTE: You must not change the order of arguments.
|
|---|
| 59 | CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
|
|---|
| 60 | else
|
|---|
| 61 | CC_JOB = $(CC) $< -o $@
|
|---|
| 62 | endif
|
|---|
| 63 |
|
|---|
| 64 | DISTROOT = distroot
|
|---|
| 65 | INITRD = initrd
|
|---|
| 66 |
|
|---|
| 67 | INIT_TASKS = \
|
|---|
| 68 | srv/ns \
|
|---|
| 69 | srv/loader \
|
|---|
| 70 | app/init \
|
|---|
| 71 | srv/locsrv \
|
|---|
| 72 | srv/bd/rd \
|
|---|
| 73 | srv/vfs \
|
|---|
| 74 | srv/logger
|
|---|
| 75 |
|
|---|
| 76 | ifeq ($(RDFMT),tmpfs)
|
|---|
| 77 | INIT_TASKS += srv/fs/tmpfs
|
|---|
| 78 | endif
|
|---|
| 79 |
|
|---|
| 80 | ifeq ($(RDFMT),fat)
|
|---|
| 81 | INIT_TASKS += srv/fs/fat
|
|---|
| 82 | endif
|
|---|
| 83 |
|
|---|
| 84 | ifeq ($(RDFMT),ext4fs)
|
|---|
| 85 | INIT_TASKS += srv/fs/ext4fs
|
|---|
| 86 | endif
|
|---|
| 87 |
|
|---|
| 88 | RD_SRVS_ESSENTIAL = \
|
|---|
| 89 | hid/input \
|
|---|
| 90 | hid/output \
|
|---|
| 91 | hid/console \
|
|---|
| 92 | devman \
|
|---|
| 93 | fs/locfs \
|
|---|
| 94 | klog
|
|---|
| 95 |
|
|---|
| 96 | ifeq ($(CONFIG_FB), y)
|
|---|
| 97 | RD_SRVS_ESSENTIAL += \
|
|---|
| 98 | hid/compositor
|
|---|
| 99 | endif
|
|---|
| 100 |
|
|---|
| 101 | RD_SRVS_NON_ESSENTIAL = \
|
|---|
| 102 | bd/file_bd \
|
|---|
| 103 | bd/sata_bd \
|
|---|
| 104 | bd/vbd \
|
|---|
| 105 | clipboard \
|
|---|
| 106 | fs/tmpfs \
|
|---|
| 107 | fs/fat \
|
|---|
| 108 | fs/mfs \
|
|---|
| 109 | fs/cdfs \
|
|---|
| 110 | fs/exfat \
|
|---|
| 111 | fs/udf \
|
|---|
| 112 | fs/ext4fs \
|
|---|
| 113 | hid/remcons \
|
|---|
| 114 | hid/isdv4_tablet \
|
|---|
| 115 | hid/rfb \
|
|---|
| 116 | net/dhcp \
|
|---|
| 117 | net/dnsrsrv \
|
|---|
| 118 | net/ethip \
|
|---|
| 119 | net/inetsrv \
|
|---|
| 120 | net/loopip \
|
|---|
| 121 | net/nconfsrv \
|
|---|
| 122 | net/slip \
|
|---|
| 123 | net/tcp \
|
|---|
| 124 | net/udp \
|
|---|
| 125 | taskmon \
|
|---|
| 126 | test/chardev-test \
|
|---|
| 127 | test/ipc-test \
|
|---|
| 128 | volsrv
|
|---|
| 129 |
|
|---|
| 130 | RD_DRVS_ESSENTIAL = \
|
|---|
| 131 | root/root \
|
|---|
| 132 | root/virt \
|
|---|
| 133 | fb/kfb
|
|---|
| 134 |
|
|---|
| 135 | RD_DRVS_NON_ESSENTIAL = \
|
|---|
| 136 | test/test1 \
|
|---|
| 137 | test/test2 \
|
|---|
| 138 | test/test3 \
|
|---|
| 139 | nic/ne2k \
|
|---|
| 140 | nic/e1k \
|
|---|
| 141 | nic/rtl8139 \
|
|---|
| 142 | nic/rtl8169 \
|
|---|
| 143 | nic/ar9271 \
|
|---|
| 144 | nic/virtio-net \
|
|---|
| 145 | block/ahci \
|
|---|
| 146 | block/virtio-blk
|
|---|
| 147 |
|
|---|
| 148 | RD_APPS_ESSENTIAL = \
|
|---|
| 149 | bdsh \
|
|---|
| 150 | getterm \
|
|---|
| 151 | kio
|
|---|
| 152 |
|
|---|
| 153 | ifeq ($(CONFIG_FB), y)
|
|---|
| 154 | RD_APPS_ESSENTIAL += \
|
|---|
| 155 | vlaunch \
|
|---|
| 156 | vterm
|
|---|
| 157 | endif
|
|---|
| 158 |
|
|---|
| 159 | RD_APPS_NON_ESSENTIAL = \
|
|---|
| 160 | barber \
|
|---|
| 161 | bithenge \
|
|---|
| 162 | blkdump \
|
|---|
| 163 | contacts \
|
|---|
| 164 | corecfg \
|
|---|
| 165 | cpptest \
|
|---|
| 166 | devctl \
|
|---|
| 167 | dnscfg \
|
|---|
| 168 | dnsres \
|
|---|
| 169 | download \
|
|---|
| 170 | edit \
|
|---|
| 171 | fdisk \
|
|---|
| 172 | gunzip \
|
|---|
| 173 | hbench \
|
|---|
| 174 | inet \
|
|---|
| 175 | kill \
|
|---|
| 176 | killall \
|
|---|
| 177 | loc \
|
|---|
| 178 | lprint \
|
|---|
| 179 | mixerctl \
|
|---|
| 180 | modplay \
|
|---|
| 181 | logset \
|
|---|
| 182 | mkfat \
|
|---|
| 183 | mkexfat \
|
|---|
| 184 | mkext4 \
|
|---|
| 185 | mkmfs \
|
|---|
| 186 | nic \
|
|---|
| 187 | sbi \
|
|---|
| 188 | sportdmp \
|
|---|
| 189 | redir \
|
|---|
| 190 | taskdump \
|
|---|
| 191 | tester \
|
|---|
| 192 | testread \
|
|---|
| 193 | testrunner \
|
|---|
| 194 | testwrit \
|
|---|
| 195 | tetris \
|
|---|
| 196 | tmon \
|
|---|
| 197 | trace \
|
|---|
| 198 | netecho \
|
|---|
| 199 | nterm \
|
|---|
| 200 | pci \
|
|---|
| 201 | ping \
|
|---|
| 202 | pkg \
|
|---|
| 203 | stats \
|
|---|
| 204 | sysinfo \
|
|---|
| 205 | sysinst \
|
|---|
| 206 | top \
|
|---|
| 207 | untar \
|
|---|
| 208 | usbinfo \
|
|---|
| 209 | vol \
|
|---|
| 210 | vuhid \
|
|---|
| 211 | mkbd \
|
|---|
| 212 | websrv \
|
|---|
| 213 | date \
|
|---|
| 214 | vcalc \
|
|---|
| 215 | vdemo \
|
|---|
| 216 | viewer \
|
|---|
| 217 | df \
|
|---|
| 218 | fontviewer \
|
|---|
| 219 | wifi_supplicant
|
|---|
| 220 |
|
|---|
| 221 | ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)
|
|---|
| 222 | RD_APPS_NON_ESSENTIAL += dltest dltests
|
|---|
| 223 | endif
|
|---|
| 224 |
|
|---|
| 225 | COMPONENTS = \
|
|---|
| 226 | $(DIST_PATH)/boot/kernel.elf \
|
|---|
| 227 | $(addprefix $(DIST_PATH)/,$(INIT_TASKS)) \
|
|---|
| 228 | $(INITRD).img
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 | LINK = arch/$(BARCH)/_link.ld
|
|---|
| 232 | COMP = component
|
|---|
| 233 | COMPS = $(COMP)s
|
|---|
| 234 |
|
|---|
| 235 | -include arch/$(BARCH)/Makefile.inc
|
|---|
| 236 |
|
|---|
| 237 | ifeq ($(CONFIG_BAREBONE),y)
|
|---|
| 238 | RD_SRVS = $(RD_SRVS_ESSENTIAL)
|
|---|
| 239 | RD_APPS = $(RD_APPS_ESSENTIAL)
|
|---|
| 240 | RD_DRVS = $(RD_DRVS_ESSENTIAL)
|
|---|
| 241 | else
|
|---|
| 242 | RD_SRVS = $(RD_SRVS_ESSENTIAL) $(RD_SRVS_NON_ESSENTIAL)
|
|---|
| 243 | RD_APPS = $(RD_APPS_ESSENTIAL) $(RD_APPS_NON_ESSENTIAL)
|
|---|
| 244 | RD_DRVS = $(RD_DRVS_ESSENTIAL) $(RD_DRVS_NON_ESSENTIAL)
|
|---|
| 245 | endif
|
|---|
| 246 |
|
|---|
| 247 | MODULES := $(notdir $(COMPONENTS))
|
|---|
| 248 |
|
|---|
| 249 | BOOT_OUTPUT ?= $(ROOT_PATH)/image.boot
|
|---|
| 250 | RAW ?= image.raw
|
|---|
| 251 | JOB ?= image.job
|
|---|
| 252 | MAP ?= image.map
|
|---|
| 253 | BUILD ?= Makefile.build
|
|---|