[81235588] | 1 | #
|
---|
[4872160] | 2 | # Copyright (c) 2006 Martin Decky
|
---|
[81235588] | 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 |
|
---|
[4872160] | 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
|
---|
[e428bec] | 46 | DIST_PATH = $(BUILD_DIR)/dist
|
---|
[53238ba] | 47 | DIST_OVERLAY_PATH = $(USPACE_PATH)/overlay
|
---|
[4872160] | 48 | TOOLS_PATH = $(ROOT_PATH)/tools
|
---|
[a79d88d] | 49 | DRVS_PATH = drv
|
---|
[4872160] | 50 |
|
---|
[4646710] | 51 | MKARRAY = $(TOOLS_PATH)/mkarray.py
|
---|
[4872160] | 52 | MKFAT = $(TOOLS_PATH)/mkfat.py
|
---|
[d06c4ae] | 53 | MKEXT4 = $(TOOLS_PATH)/mkext4.py
|
---|
[928d983] | 54 | MKUIMAGE = $(TOOLS_PATH)/mkuimage.py
|
---|
[4872160] | 55 |
|
---|
[7f881cd8] | 56 | ifeq ($(PRECHECK),y)
|
---|
| 57 | JOBFILE = $(TOOLS_PATH)/jobfile.py
|
---|
[95d45482] | 58 | # NOTE: You must not change the order of arguments.
|
---|
[7f881cd8] | 59 | CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
|
---|
| 60 | else
|
---|
| 61 | CC_JOB = $(CC) $< -o $@
|
---|
| 62 | endif
|
---|
[4872160] | 63 |
|
---|
| 64 | DISTROOT = distroot
|
---|
[81235588] | 65 | INITRD = initrd
|
---|
| 66 |
|
---|
| 67 | INIT_TASKS = \
|
---|
[5fd05862] | 68 | srv/ns \
|
---|
| 69 | srv/loader \
|
---|
| 70 | app/init \
|
---|
| 71 | srv/locsrv \
|
---|
| 72 | srv/bd/rd \
|
---|
| 73 | srv/vfs \
|
---|
| 74 | srv/logger
|
---|
[14f1db0] | 75 |
|
---|
[81235588] | 76 | ifeq ($(RDFMT),tmpfs)
|
---|
[5fd05862] | 77 | INIT_TASKS += srv/fs/tmpfs
|
---|
[81235588] | 78 | endif
|
---|
[14f1db0] | 79 |
|
---|
[81235588] | 80 | ifeq ($(RDFMT),fat)
|
---|
[5fd05862] | 81 | INIT_TASKS += srv/fs/fat
|
---|
[81235588] | 82 | endif
|
---|
| 83 |
|
---|
[d06c4ae] | 84 | ifeq ($(RDFMT),ext4fs)
|
---|
[5fd05862] | 85 | INIT_TASKS += srv/fs/ext4fs
|
---|
[cc1a727] | 86 | endif
|
---|
| 87 |
|
---|
[81235588] | 88 | COMPONENTS = \
|
---|
[2fff3c4] | 89 | $(DIST_PATH)/boot/kernel.elf \
|
---|
[5fd05862] | 90 | $(addprefix $(DIST_PATH)/,$(INIT_TASKS)) \
|
---|
[4872160] | 91 | $(INITRD).img
|
---|
[14f1db0] | 92 |
|
---|
[94c05b89] | 93 |
|
---|
[4872160] | 94 | LINK = arch/$(BARCH)/_link.ld
|
---|
[4646710] | 95 | COMP = component
|
---|
| 96 | COMPS = $(COMP)s
|
---|
[14f1db0] | 97 |
|
---|
[4872160] | 98 | -include arch/$(BARCH)/Makefile.inc
|
---|
[21580dd] | 99 |
|
---|
[4872160] | 100 | MODULES := $(notdir $(COMPONENTS))
|
---|
| 101 |
|
---|
| 102 | BOOT_OUTPUT ?= $(ROOT_PATH)/image.boot
|
---|
| 103 | RAW ?= image.raw
|
---|
| 104 | JOB ?= image.job
|
---|
| 105 | MAP ?= image.map
|
---|
| 106 | BUILD ?= Makefile.build
|
---|