| [0e4ab80] | 1 | #
|
|---|
| [df4ed85] | 2 | # Copyright (c) 2005 Martin Decky
|
|---|
| [079f440] | 3 | # Copyright (c) 2007 Jakub Jermar
|
|---|
| [0e4ab80] | 4 | # All rights reserved.
|
|---|
| 5 | #
|
|---|
| 6 | # Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | # modification, are permitted provided that the following conditions
|
|---|
| 8 | # are met:
|
|---|
| 9 | #
|
|---|
| 10 | # - Redistributions of source code must retain the above copyright
|
|---|
| 11 | # notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | # - Redistributions in binary form must reproduce the above copyright
|
|---|
| 13 | # notice, this list of conditions and the following disclaimer in the
|
|---|
| 14 | # documentation and/or other materials provided with the distribution.
|
|---|
| 15 | # - The name of the author may not be used to endorse or promote products
|
|---|
| 16 | # derived from this software without specific prior written permission.
|
|---|
| 17 | #
|
|---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 28 | #
|
|---|
| [3eddaff] | 29 |
|
|---|
| [1b1164e8] | 30 | USPACE_PREFIX = ../..
|
|---|
| 31 | ROOT_PATH = $(USPACE_PREFIX)/..
|
|---|
| [3eddaff] | 32 |
|
|---|
| [079f440] | 33 | INCLUDE_KERNEL = include/kernel
|
|---|
| 34 | INCLUDE_ARCH = include/arch
|
|---|
| 35 | INCLUDE_LIBARCH = include/libarch
|
|---|
| [04803bf] | 36 | INCLUDE_RTLDARCH = rtld/include/arch
|
|---|
| [3eddaff] | 37 |
|
|---|
| [1b1164e8] | 38 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
|---|
| [4196304] | 39 | COMMON_HEADER = $(ROOT_PATH)/common.h
|
|---|
| 40 | COMMON_HEADER_ARCH = arch/$(UARCH)/include/common.h
|
|---|
| [ac47b7c2] | 41 |
|
|---|
| [1b1164e8] | 42 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
|---|
| [3eddaff] | 43 |
|
|---|
| [04803bf] | 44 | PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(INCLUDE_RTLDARCH) $(COMMON_HEADER_ARCH)
|
|---|
| [4196304] | 45 | EXTRA_OUTPUT = $(LINKER_SCRIPT)
|
|---|
| [04803bf] | 46 | EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(INCLUDE_RTLDARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPT)
|
|---|
| [4196304] | 47 | LIBRARY = libc
|
|---|
| [ec3e2ed0] | 48 | SLIBRARY = libc.so.0.0
|
|---|
| 49 | LSONAME = libc.so.0
|
|---|
| 50 |
|
|---|
| [0e4ab80] | 51 |
|
|---|
| [1b1164e8] | 52 | -include $(COMMON_MAKEFILE)
|
|---|
| 53 | -include $(CONFIG_MAKEFILE)
|
|---|
| 54 | -include arch/$(UARCH)/Makefile.inc
|
|---|
| [04803bf] | 55 | -include rtld/arch/$(UARCH)/Makefile.inc
|
|---|
| [fcd7053] | 56 |
|
|---|
| [04803bf] | 57 | EXTRA_CFLAGS += -Irtld/include -I../../srv/loader/include
|
|---|
| [0e4ab80] | 58 |
|
|---|
| 59 | GENERIC_SOURCES = \
|
|---|
| [cc6f688] | 60 | generic/libc.c \
|
|---|
| [a1e17fc] | 61 | generic/ddi.c \
|
|---|
| [11fa83a] | 62 | generic/as.c \
|
|---|
| [7981e3cc] | 63 | generic/cap.c \
|
|---|
| [079f440] | 64 | generic/clipboard.c \
|
|---|
| [1090b8c] | 65 | generic/devmap.c \
|
|---|
| [729fa2d6] | 66 | generic/devman.c \
|
|---|
| [5cd136ab] | 67 | generic/device/hw_res.c \
|
|---|
| [ce79069b] | 68 | generic/device/char_dev.c \
|
|---|
| [04803bf] | 69 | generic/dlfcn.c \
|
|---|
| [05641a9e] | 70 | generic/event.c \
|
|---|
| [db24058] | 71 | generic/errno.c \
|
|---|
| [e64c4b2] | 72 | generic/mem.c \
|
|---|
| [19f857a] | 73 | generic/str.c \
|
|---|
| [2721a75] | 74 | generic/str_error.c \
|
|---|
| [fa23560] | 75 | generic/fibril.c \
|
|---|
| [079f440] | 76 | generic/fibril_synch.c \
|
|---|
| [c98e6ee] | 77 | generic/pcb.c \
|
|---|
| 78 | generic/smc.c \
|
|---|
| [c05290e] | 79 | generic/thread.c \
|
|---|
| [fa23560] | 80 | generic/tls.c \
|
|---|
| [f30e6a0b] | 81 | generic/task.c \
|
|---|
| [1cef26f] | 82 | generic/futex.c \
|
|---|
| [ab00d5a] | 83 | generic/io/asprintf.c \
|
|---|
| [4e2cf8b] | 84 | generic/io/io.c \
|
|---|
| [3214a20] | 85 | generic/io/printf.c \
|
|---|
| [9b415c9] | 86 | generic/io/log.c \
|
|---|
| [2595dab] | 87 | generic/io/klog.c \
|
|---|
| [3214a20] | 88 | generic/io/snprintf.c \
|
|---|
| 89 | generic/io/vprintf.c \
|
|---|
| 90 | generic/io/vsnprintf.c \
|
|---|
| 91 | generic/io/printf_core.c \
|
|---|
| [2595dab] | 92 | generic/io/console.c \
|
|---|
| [369a5f8] | 93 | generic/io/screenbuffer.c \
|
|---|
| [007e6efa] | 94 | generic/ipc/ns.c \
|
|---|
| [db24058] | 95 | generic/malloc.c \
|
|---|
| [450cd3a] | 96 | generic/sysinfo.c \
|
|---|
| [80649a91] | 97 | generic/ipc.c \
|
|---|
| 98 | generic/async.c \
|
|---|
| [7907cf9] | 99 | generic/async_sess.c \
|
|---|
| [45454e9b] | 100 | generic/loader.c \
|
|---|
| [216d6fc] | 101 | generic/getopt.c \
|
|---|
| [a99330e] | 102 | generic/adt/list.c \
|
|---|
| 103 | generic/adt/hash_table.c \
|
|---|
| [7390870] | 104 | generic/adt/dynamic_fifo.c \
|
|---|
| 105 | generic/adt/measured_strings.c \
|
|---|
| 106 | generic/adt/char_map.c \
|
|---|
| [c594489] | 107 | generic/time.c \
|
|---|
| [83b1d61] | 108 | generic/stdlib.c \
|
|---|
| [2f02aa17] | 109 | generic/mman.c \
|
|---|
| [9a1b20c] | 110 | generic/udebug.c \
|
|---|
| [dadcec1] | 111 | generic/vfs/vfs.c \
|
|---|
| [1ea99cc] | 112 | generic/vfs/canonify.c \
|
|---|
| [e4554d4] | 113 | generic/net/inet.c \
|
|---|
| [753bca3] | 114 | generic/net/icmp_common.c \
|
|---|
| 115 | generic/net/icmp_api.c \
|
|---|
| [c7a8442] | 116 | generic/net/modules.c \
|
|---|
| [c69d327] | 117 | generic/net/packet.c \
|
|---|
| [d9e2e0e] | 118 | generic/net/socket_client.c \
|
|---|
| 119 | generic/net/socket_parse.c \
|
|---|
| [0a72efc] | 120 | generic/stacktrace.c \
|
|---|
| [88dea9d] | 121 | generic/arg_parse.c \
|
|---|
| [549012c] | 122 | generic/sort.c \
|
|---|
| [04803bf] | 123 | generic/stats.c \
|
|---|
| [1ea99cc] | 124 | rtld/rtld.c \
|
|---|
| 125 | rtld/elf_load.c \
|
|---|
| 126 | rtld/dynamic.c \
|
|---|
| 127 | rtld/module.c \
|
|---|
| 128 | rtld/symbol.c
|
|---|
| 129 |
|
|---|
| [079f440] | 130 | SOURCES = \
|
|---|
| 131 | $(GENERIC_SOURCES) \
|
|---|
| 132 | $(ARCH_SOURCES)
|
|---|
| [0e4ab80] | 133 |
|
|---|
| [1b1164e8] | 134 | include $(USPACE_PREFIX)/Makefile.common
|
|---|
| [3eddaff] | 135 |
|
|---|
| [079f440] | 136 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
|---|
| 137 | ln -sfn kernel/arch $@
|
|---|
| [25b0e6a] | 138 |
|
|---|
| [079f440] | 139 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
|---|
| 140 | ln -sfn ../$< $@
|
|---|
| [3eddaff] | 141 |
|
|---|
| [04803bf] | 142 | $(INCLUDE_RTLDARCH): rtld/arch/$(UARCH)/include
|
|---|
| 143 | ln -sfn ../../$< $@
|
|---|
| [3eddaff] | 144 |
|
|---|
| [079f440] | 145 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
|---|
| [1ea99cc] | 146 |
|
|---|
| [079f440] | 147 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
|---|
| 148 | ln -sfn ../$< $@
|
|---|
| [1ea99cc] | 149 |
|
|---|
| [1b1164e8] | 150 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
|---|
| 151 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
|---|
| [1ea99cc] | 152 |
|
|---|
| [4196304] | 153 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
|
|---|
| 154 | ln -sfn ../../../$< $@
|
|---|