[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 |
|
---|
| 33 | INCLUDE_KERNEL = include/kernel
|
---|
| 34 | INCLUDE_ARCH = include/arch
|
---|
| 35 | INCLUDE_LIBARCH = include/libarch
|
---|
| 36 |
|
---|
[1b1164e8] | 37 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
---|
[4196304] | 38 | COMMON_HEADER = $(ROOT_PATH)/common.h
|
---|
| 39 | COMMON_HEADER_ARCH = arch/$(UARCH)/include/common.h
|
---|
| 40 |
|
---|
[1b1164e8] | 41 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
---|
| 42 |
|
---|
[4196304] | 43 | PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH)
|
---|
| 44 | EXTRA_OUTPUT = $(LINKER_SCRIPT)
|
---|
| 45 | EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPT)
|
---|
| 46 | LIBRARY = libc
|
---|
| 47 |
|
---|
[1b1164e8] | 48 | -include $(COMMON_MAKEFILE)
|
---|
| 49 | -include $(CONFIG_MAKEFILE)
|
---|
| 50 | -include arch/$(UARCH)/Makefile.inc
|
---|
[079f440] | 51 |
|
---|
| 52 | GENERIC_SOURCES = \
|
---|
| 53 | generic/libc.c \
|
---|
| 54 | generic/ddi.c \
|
---|
| 55 | generic/as.c \
|
---|
| 56 | generic/cap.c \
|
---|
| 57 | generic/clipboard.c \
|
---|
| 58 | generic/devmap.c \
|
---|
[729fa2d6] | 59 | generic/devman.c \
|
---|
[5cd136ab] | 60 | generic/device/hw_res.c \
|
---|
[ce79069b] | 61 | generic/device/char_dev.c \
|
---|
[079f440] | 62 | generic/event.c \
|
---|
| 63 | generic/errno.c \
|
---|
| 64 | generic/mem.c \
|
---|
[19f857a] | 65 | generic/str.c \
|
---|
[2721a75] | 66 | generic/str_error.c \
|
---|
[749f18c5] | 67 | generic/l18n/langs.c \
|
---|
[079f440] | 68 | generic/fibril.c \
|
---|
| 69 | generic/fibril_synch.c \
|
---|
| 70 | generic/pcb.c \
|
---|
| 71 | generic/smc.c \
|
---|
| 72 | generic/thread.c \
|
---|
| 73 | generic/tls.c \
|
---|
| 74 | generic/task.c \
|
---|
| 75 | generic/futex.c \
|
---|
| 76 | generic/io/asprintf.c \
|
---|
| 77 | generic/io/io.c \
|
---|
| 78 | generic/io/printf.c \
|
---|
| 79 | generic/io/klog.c \
|
---|
| 80 | generic/io/snprintf.c \
|
---|
| 81 | generic/io/vprintf.c \
|
---|
| 82 | generic/io/vsnprintf.c \
|
---|
| 83 | generic/io/printf_core.c \
|
---|
| 84 | generic/io/console.c \
|
---|
[369a5f8] | 85 | generic/io/screenbuffer.c \
|
---|
[007e6efa] | 86 | generic/ipc/ns.c \
|
---|
[079f440] | 87 | generic/malloc.c \
|
---|
| 88 | generic/sysinfo.c \
|
---|
| 89 | generic/ipc.c \
|
---|
| 90 | generic/async.c \
|
---|
[7907cf9] | 91 | generic/async_sess.c \
|
---|
[079f440] | 92 | generic/loader.c \
|
---|
| 93 | generic/getopt.c \
|
---|
[a99330e] | 94 | generic/adt/list.c \
|
---|
| 95 | generic/adt/hash_table.c \
|
---|
[7390870] | 96 | generic/adt/dynamic_fifo.c \
|
---|
| 97 | generic/adt/measured_strings.c \
|
---|
| 98 | generic/adt/char_map.c \
|
---|
[079f440] | 99 | generic/time.c \
|
---|
| 100 | generic/stdlib.c \
|
---|
| 101 | generic/mman.c \
|
---|
| 102 | generic/udebug.c \
|
---|
| 103 | generic/vfs/vfs.c \
|
---|
| 104 | generic/vfs/canonify.c \
|
---|
[e4554d4] | 105 | generic/net/inet.c \
|
---|
[753bca3] | 106 | generic/net/icmp_common.c \
|
---|
| 107 | generic/net/icmp_api.c \
|
---|
[c7a8442] | 108 | generic/net/modules.c \
|
---|
[c69d327] | 109 | generic/net/packet.c \
|
---|
[d9e2e0e] | 110 | generic/net/socket_client.c \
|
---|
| 111 | generic/net/socket_parse.c \
|
---|
[0a72efc] | 112 | generic/stacktrace.c \
|
---|
[88dea9d] | 113 | generic/arg_parse.c \
|
---|
[549012c] | 114 | generic/sort.c \
|
---|
[9dae191e] | 115 | generic/stats.c
|
---|
[079f440] | 116 |
|
---|
| 117 | SOURCES = \
|
---|
| 118 | $(GENERIC_SOURCES) \
|
---|
| 119 | $(ARCH_SOURCES)
|
---|
| 120 |
|
---|
[1b1164e8] | 121 | include $(USPACE_PREFIX)/Makefile.common
|
---|
[079f440] | 122 |
|
---|
| 123 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
---|
| 124 | ln -sfn kernel/arch $@
|
---|
| 125 |
|
---|
| 126 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
---|
| 127 | ln -sfn ../$< $@
|
---|
| 128 |
|
---|
| 129 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
---|
| 130 |
|
---|
| 131 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
---|
| 132 | ln -sfn ../$< $@
|
---|
| 133 |
|
---|
[1b1164e8] | 134 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
---|
| 135 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
---|
[4196304] | 136 |
|
---|
| 137 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
|
---|
| 138 | ln -sfn ../../../$< $@
|
---|