[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
|
---|
[ec3e2ed] | 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 \
|
---|
[2595dab] | 86 | generic/io/klog.c \
|
---|
[3214a20] | 87 | generic/io/snprintf.c \
|
---|
| 88 | generic/io/vprintf.c \
|
---|
| 89 | generic/io/vsnprintf.c \
|
---|
| 90 | generic/io/printf_core.c \
|
---|
[2595dab] | 91 | generic/io/console.c \
|
---|
[369a5f8] | 92 | generic/io/screenbuffer.c \
|
---|
[007e6efa] | 93 | generic/ipc/ns.c \
|
---|
[db24058] | 94 | generic/malloc.c \
|
---|
[450cd3a] | 95 | generic/sysinfo.c \
|
---|
[80649a91] | 96 | generic/ipc.c \
|
---|
| 97 | generic/async.c \
|
---|
[7907cf9] | 98 | generic/async_sess.c \
|
---|
[45454e9b] | 99 | generic/loader.c \
|
---|
[216d6fc] | 100 | generic/getopt.c \
|
---|
[a99330e] | 101 | generic/adt/list.c \
|
---|
| 102 | generic/adt/hash_table.c \
|
---|
[7390870] | 103 | generic/adt/dynamic_fifo.c \
|
---|
| 104 | generic/adt/measured_strings.c \
|
---|
| 105 | generic/adt/char_map.c \
|
---|
[c594489] | 106 | generic/time.c \
|
---|
[83b1d61] | 107 | generic/stdlib.c \
|
---|
[2f02aa17] | 108 | generic/mman.c \
|
---|
[9a1b20c] | 109 | generic/udebug.c \
|
---|
[dadcec1] | 110 | generic/vfs/vfs.c \
|
---|
[1ea99cc] | 111 | generic/vfs/canonify.c \
|
---|
[e4554d4] | 112 | generic/net/inet.c \
|
---|
[753bca3] | 113 | generic/net/icmp_common.c \
|
---|
| 114 | generic/net/icmp_api.c \
|
---|
[c7a8442] | 115 | generic/net/modules.c \
|
---|
[c69d327] | 116 | generic/net/packet.c \
|
---|
[d9e2e0e] | 117 | generic/net/socket_client.c \
|
---|
| 118 | generic/net/socket_parse.c \
|
---|
[0a72efc] | 119 | generic/stacktrace.c \
|
---|
[88dea9d] | 120 | generic/arg_parse.c \
|
---|
[549012c] | 121 | generic/sort.c \
|
---|
[04803bf] | 122 | generic/stats.c \
|
---|
[1ea99cc] | 123 | rtld/rtld.c \
|
---|
| 124 | rtld/elf_load.c \
|
---|
| 125 | rtld/dynamic.c \
|
---|
| 126 | rtld/module.c \
|
---|
| 127 | rtld/symbol.c
|
---|
| 128 |
|
---|
[079f440] | 129 | SOURCES = \
|
---|
| 130 | $(GENERIC_SOURCES) \
|
---|
| 131 | $(ARCH_SOURCES)
|
---|
[0e4ab80] | 132 |
|
---|
[1b1164e8] | 133 | include $(USPACE_PREFIX)/Makefile.common
|
---|
[3eddaff] | 134 |
|
---|
[079f440] | 135 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
---|
| 136 | ln -sfn kernel/arch $@
|
---|
[25b0e6a] | 137 |
|
---|
[079f440] | 138 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
---|
| 139 | ln -sfn ../$< $@
|
---|
[3eddaff] | 140 |
|
---|
[04803bf] | 141 | $(INCLUDE_RTLDARCH): rtld/arch/$(UARCH)/include
|
---|
| 142 | ln -sfn ../../$< $@
|
---|
[3eddaff] | 143 |
|
---|
[079f440] | 144 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
---|
[1ea99cc] | 145 |
|
---|
[079f440] | 146 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
---|
| 147 | ln -sfn ../$< $@
|
---|
[1ea99cc] | 148 |
|
---|
[1b1164e8] | 149 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
---|
| 150 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
---|
[1ea99cc] | 151 |
|
---|
[4196304] | 152 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
|
---|
| 153 | ln -sfn ../../../$< $@
|
---|