| 1 | #
|
|---|
| 2 | # Copyright (c) 2005 Martin Decky
|
|---|
| 3 | # Copyright (c) 2007 Jakub Jermar
|
|---|
| 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 | #
|
|---|
| 29 |
|
|---|
| 30 | USPACE_PREFIX = ../..
|
|---|
| 31 | ROOT_PATH = $(USPACE_PREFIX)/..
|
|---|
| 32 |
|
|---|
| 33 | INCLUDE_KERNEL = include/kernel
|
|---|
| 34 | INCLUDE_ARCH = include/arch
|
|---|
| 35 | INCLUDE_LIBARCH = include/libarch
|
|---|
| 36 |
|
|---|
| 37 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
|---|
| 38 | COMMON_HEADER = $(ROOT_PATH)/common.h
|
|---|
| 39 | COMMON_HEADER_ARCH = arch/$(UARCH)/include/common.h
|
|---|
| 40 |
|
|---|
| 41 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
|---|
| 42 |
|
|---|
| 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 |
|
|---|
| 48 | -include $(COMMON_MAKEFILE)
|
|---|
| 49 | -include $(CONFIG_MAKEFILE)
|
|---|
| 50 | -include arch/$(UARCH)/Makefile.inc
|
|---|
| 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 \
|
|---|
| 59 | generic/devman.c \
|
|---|
| 60 | generic/device/hw_res.c \
|
|---|
| 61 | generic/device/char_dev.c \
|
|---|
| 62 | generic/event.c \
|
|---|
| 63 | generic/errno.c \
|
|---|
| 64 | generic/mem.c \
|
|---|
| 65 | generic/str.c \
|
|---|
| 66 | generic/str_error.c \
|
|---|
| 67 | generic/l18n/langs.c \
|
|---|
| 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/log.c \
|
|---|
| 80 | generic/io/klog.c \
|
|---|
| 81 | generic/io/snprintf.c \
|
|---|
| 82 | generic/io/vprintf.c \
|
|---|
| 83 | generic/io/vsnprintf.c \
|
|---|
| 84 | generic/io/printf_core.c \
|
|---|
| 85 | generic/io/console.c \
|
|---|
| 86 | generic/io/screenbuffer.c \
|
|---|
| 87 | generic/ipc/ns.c \
|
|---|
| 88 | generic/malloc.c \
|
|---|
| 89 | generic/sysinfo.c \
|
|---|
| 90 | generic/ipc.c \
|
|---|
| 91 | generic/async.c \
|
|---|
| 92 | generic/async_sess.c \
|
|---|
| 93 | generic/loader.c \
|
|---|
| 94 | generic/getopt.c \
|
|---|
| 95 | generic/adt/list.c \
|
|---|
| 96 | generic/adt/hash_table.c \
|
|---|
| 97 | generic/adt/dynamic_fifo.c \
|
|---|
| 98 | generic/adt/measured_strings.c \
|
|---|
| 99 | generic/adt/char_map.c \
|
|---|
| 100 | generic/time.c \
|
|---|
| 101 | generic/stdlib.c \
|
|---|
| 102 | generic/mman.c \
|
|---|
| 103 | generic/udebug.c \
|
|---|
| 104 | generic/vfs/vfs.c \
|
|---|
| 105 | generic/vfs/canonify.c \
|
|---|
| 106 | generic/net/inet.c \
|
|---|
| 107 | generic/net/icmp_common.c \
|
|---|
| 108 | generic/net/icmp_api.c \
|
|---|
| 109 | generic/net/modules.c \
|
|---|
| 110 | generic/net/packet.c \
|
|---|
| 111 | generic/net/socket_client.c \
|
|---|
| 112 | generic/net/socket_parse.c \
|
|---|
| 113 | generic/stacktrace.c \
|
|---|
| 114 | generic/arg_parse.c \
|
|---|
| 115 | generic/sort.c \
|
|---|
| 116 | generic/stats.c
|
|---|
| 117 |
|
|---|
| 118 | SOURCES = \
|
|---|
| 119 | $(GENERIC_SOURCES) \
|
|---|
| 120 | $(ARCH_SOURCES)
|
|---|
| 121 |
|
|---|
| 122 | include $(USPACE_PREFIX)/Makefile.common
|
|---|
| 123 |
|
|---|
| 124 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
|---|
| 125 | ln -sfn kernel/arch $@
|
|---|
| 126 |
|
|---|
| 127 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
|---|
| 128 | ln -sfn ../$< $@
|
|---|
| 129 |
|
|---|
| 130 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
|---|
| 131 |
|
|---|
| 132 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
|---|
| 133 | ln -sfn ../$< $@
|
|---|
| 134 |
|
|---|
| 135 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
|---|
| 136 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
|---|
| 137 |
|
|---|
| 138 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
|
|---|
| 139 | ln -sfn ../../../$< $@
|
|---|