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