| [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)/.. | 
|---|
| [079f440] | 32 |  | 
|---|
| [1b1164e8] | 33 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common | 
|---|
| [4196304] | 34 | COMMON_HEADER = $(ROOT_PATH)/common.h | 
|---|
| [aebcd42] | 35 | COMMON_HEADER_ARCH = arch/$(UARCH)/include/libarch/common.h | 
|---|
| [4196304] | 36 |  | 
|---|
| [1b1164e8] | 37 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config | 
|---|
|  | 38 |  | 
|---|
| [c53d906] | 39 | LINKER_SCRIPTS = \ | 
|---|
|  | 40 | $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld \ | 
|---|
| [729f774f] | 41 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld \ | 
|---|
|  | 42 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld \ | 
|---|
|  | 43 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld | 
|---|
| [c53d906] | 44 |  | 
|---|
| [6c5fc8e] | 45 | PRE_DEPEND = $(COMMON_HEADER_ARCH) | 
|---|
| [c53d906] | 46 | EXTRA_OUTPUT = $(LINKER_SCRIPTS) | 
|---|
| [6c5fc8e] | 47 | EXTRA_CLEAN = $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS) | 
|---|
| [4196304] | 48 | LIBRARY = libc | 
|---|
| [ec3e2ed0] | 49 | SLIBRARY = libc.so.0.0 | 
|---|
| [042fbe0] | 50 | LSONAME = libc.so0 | 
|---|
| [ec3e2ed0] | 51 |  | 
|---|
| [4196304] | 52 |  | 
|---|
| [1b1164e8] | 53 | -include $(COMMON_MAKEFILE) | 
|---|
|  | 54 | -include $(CONFIG_MAKEFILE) | 
|---|
|  | 55 | -include arch/$(UARCH)/Makefile.inc | 
|---|
| [079f440] | 56 |  | 
|---|
|  | 57 | GENERIC_SOURCES = \ | 
|---|
|  | 58 | generic/libc.c \ | 
|---|
|  | 59 | generic/ddi.c \ | 
|---|
|  | 60 | generic/as.c \ | 
|---|
| [4802dd7] | 61 | generic/bd.c \ | 
|---|
|  | 62 | generic/bd_srv.c \ | 
|---|
| [079f440] | 63 | generic/cap.c \ | 
|---|
| [47fecbb] | 64 | generic/cfg.c \ | 
|---|
| [079f440] | 65 | generic/clipboard.c \ | 
|---|
| [729fa2d6] | 66 | generic/devman.c \ | 
|---|
| [5cd136ab] | 67 | generic/device/hw_res.c \ | 
|---|
| [00d7e1b] | 68 | generic/device/hw_res_parsed.c \ | 
|---|
| [ce79069b] | 69 | generic/device/char_dev.c \ | 
|---|
| [02b38730] | 70 | generic/device/clock_dev.c \ | 
|---|
| [917797f] | 71 | generic/device/battery_dev.c \ | 
|---|
| [6d5e378] | 72 | generic/device/graph_dev.c \ | 
|---|
| [609243f4] | 73 | generic/device/nic.c \ | 
|---|
| [b402dadd] | 74 | generic/device/pci.c \ | 
|---|
| [9904eb90] | 75 | generic/device/ahci.c \ | 
|---|
| [31e9fe0] | 76 | generic/dnsr.c \ | 
|---|
| [c6f1eb05] | 77 | generic/dlfcn.c \ | 
|---|
| [bfdb5af1] | 78 | generic/elf/elf_load.c \ | 
|---|
| [079f440] | 79 | generic/event.c \ | 
|---|
|  | 80 | generic/errno.c \ | 
|---|
| [15f3c3f] | 81 | generic/loc.c \ | 
|---|
| [079f440] | 82 | generic/mem.c \ | 
|---|
| [19f857a] | 83 | generic/str.c \ | 
|---|
| [2721a75] | 84 | generic/str_error.c \ | 
|---|
| [749f18c5] | 85 | generic/l18n/langs.c \ | 
|---|
| [079f440] | 86 | generic/fibril.c \ | 
|---|
|  | 87 | generic/fibril_synch.c \ | 
|---|
|  | 88 | generic/pcb.c \ | 
|---|
|  | 89 | generic/smc.c \ | 
|---|
|  | 90 | generic/thread.c \ | 
|---|
|  | 91 | generic/tls.c \ | 
|---|
|  | 92 | generic/task.c \ | 
|---|
|  | 93 | generic/futex.c \ | 
|---|
| [3495654] | 94 | generic/inet/addr.c \ | 
|---|
| [c76e926] | 95 | generic/inet.c \ | 
|---|
| [0e25780] | 96 | generic/inetcfg.c \ | 
|---|
| [6428115] | 97 | generic/inetping.c \ | 
|---|
| [079f440] | 98 | generic/io/asprintf.c \ | 
|---|
| [111d2d6] | 99 | generic/io/input.c \ | 
|---|
| [079f440] | 100 | generic/io/io.c \ | 
|---|
| [6d5e378] | 101 | generic/io/chargrid.c \ | 
|---|
|  | 102 | generic/io/output.c \ | 
|---|
| [079f440] | 103 | generic/io/printf.c \ | 
|---|
| [9b415c9] | 104 | generic/io/log.c \ | 
|---|
| [669f5cae] | 105 | generic/io/logctl.c \ | 
|---|
| [079f440] | 106 | generic/io/klog.c \ | 
|---|
|  | 107 | generic/io/snprintf.c \ | 
|---|
|  | 108 | generic/io/vprintf.c \ | 
|---|
|  | 109 | generic/io/vsnprintf.c \ | 
|---|
|  | 110 | generic/io/printf_core.c \ | 
|---|
| [5d94b16c] | 111 | generic/io/con_srv.c \ | 
|---|
| [079f440] | 112 | generic/io/console.c \ | 
|---|
| [6d5e378] | 113 | generic/io/visualizer.c \ | 
|---|
|  | 114 | generic/io/window.c \ | 
|---|
| [f834f90d] | 115 | generic/iplink.c \ | 
|---|
|  | 116 | generic/iplink_srv.c \ | 
|---|
| [34b9299] | 117 | generic/ieee_double.c \ | 
|---|
|  | 118 | generic/power_of_ten.c \ | 
|---|
|  | 119 | generic/double_to_str.c \ | 
|---|
| [079f440] | 120 | generic/malloc.c \ | 
|---|
|  | 121 | generic/sysinfo.c \ | 
|---|
|  | 122 | generic/ipc.c \ | 
|---|
| [79ae36dd] | 123 | generic/ns.c \ | 
|---|
| [079f440] | 124 | generic/async.c \ | 
|---|
|  | 125 | generic/loader.c \ | 
|---|
|  | 126 | generic/getopt.c \ | 
|---|
| [a99330e] | 127 | generic/adt/list.c \ | 
|---|
|  | 128 | generic/adt/hash_table.c \ | 
|---|
| [7390870] | 129 | generic/adt/dynamic_fifo.c \ | 
|---|
|  | 130 | generic/adt/char_map.c \ | 
|---|
| [4e1a2f5] | 131 | generic/adt/prodcons.c \ | 
|---|
| [079f440] | 132 | generic/time.c \ | 
|---|
|  | 133 | generic/stdlib.c \ | 
|---|
|  | 134 | generic/mman.c \ | 
|---|
|  | 135 | generic/udebug.c \ | 
|---|
|  | 136 | generic/vfs/vfs.c \ | 
|---|
|  | 137 | generic/vfs/canonify.c \ | 
|---|
| [e4554d4] | 138 | generic/net/inet.c \ | 
|---|
| [d9e2e0e] | 139 | generic/net/socket_client.c \ | 
|---|
|  | 140 | generic/net/socket_parse.c \ | 
|---|
| [0aae87a6] | 141 | generic/stack.c \ | 
|---|
| [0a72efc] | 142 | generic/stacktrace.c \ | 
|---|
| [88dea9d] | 143 | generic/arg_parse.c \ | 
|---|
| [549012c] | 144 | generic/sort.c \ | 
|---|
| [04803bf] | 145 | generic/stats.c \ | 
|---|
| [acc0efb] | 146 | generic/assert.c \ | 
|---|
|  | 147 | generic/pio_trace.c | 
|---|
| [7fb3f1c] | 148 |  | 
|---|
| [79ae36dd] | 149 | ifeq ($(CONFIG_RTLD),y) | 
|---|
| [7fb3f1c] | 150 | GENERIC_SOURCES += \ | 
|---|
| [8a1fb09] | 151 | generic/rtld/rtld.c \ | 
|---|
|  | 152 | generic/rtld/dynamic.c \ | 
|---|
|  | 153 | generic/rtld/module.c \ | 
|---|
|  | 154 | generic/rtld/symbol.c | 
|---|
| [7fb3f1c] | 155 | endif | 
|---|
| [079f440] | 156 |  | 
|---|
|  | 157 | SOURCES = \ | 
|---|
|  | 158 | $(GENERIC_SOURCES) \ | 
|---|
|  | 159 | $(ARCH_SOURCES) | 
|---|
|  | 160 |  | 
|---|
| [1b1164e8] | 161 | include $(USPACE_PREFIX)/Makefile.common | 
|---|
| [079f440] | 162 |  | 
|---|
|  | 163 |  | 
|---|
| [c53d906] | 164 | $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in | 
|---|
| [1b1164e8] | 165 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@ | 
|---|
| [4196304] | 166 |  | 
|---|
| [c53d906] | 167 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in | 
|---|
|  | 168 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@ | 
|---|
|  | 169 |  | 
|---|
| [729f774f] | 170 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in | 
|---|
|  | 171 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@ | 
|---|
|  | 172 |  | 
|---|
|  | 173 | $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in | 
|---|
|  | 174 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@ | 
|---|
|  | 175 |  | 
|---|
| [4196304] | 176 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER) | 
|---|
| [aebcd42] | 177 | ln -sfn ../../../../$< $@ | 
|---|