[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 | PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
|
---|
| 38 | EXTRA_OUTPUT = $(LINKER_SCRIPT)
|
---|
| 39 | EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LINKER_SCRIPT)
|
---|
| 40 | LIBRARY = libc
|
---|
| 41 |
|
---|
| 42 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
---|
| 43 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
---|
| 44 |
|
---|
| 45 | -include $(COMMON_MAKEFILE)
|
---|
| 46 | -include $(CONFIG_MAKEFILE)
|
---|
| 47 | -include arch/$(UARCH)/Makefile.inc
|
---|
[079f440] | 48 |
|
---|
| 49 | GENERIC_SOURCES = \
|
---|
| 50 | generic/libc.c \
|
---|
| 51 | generic/ddi.c \
|
---|
| 52 | generic/as.c \
|
---|
| 53 | generic/cap.c \
|
---|
| 54 | generic/clipboard.c \
|
---|
| 55 | generic/devmap.c \
|
---|
| 56 | generic/event.c \
|
---|
| 57 | generic/errno.c \
|
---|
| 58 | generic/mem.c \
|
---|
[19f857a] | 59 | generic/str.c \
|
---|
[079f440] | 60 | generic/fibril.c \
|
---|
| 61 | generic/fibril_synch.c \
|
---|
| 62 | generic/pcb.c \
|
---|
| 63 | generic/smc.c \
|
---|
| 64 | generic/thread.c \
|
---|
| 65 | generic/tls.c \
|
---|
| 66 | generic/task.c \
|
---|
| 67 | generic/futex.c \
|
---|
| 68 | generic/io/asprintf.c \
|
---|
| 69 | generic/io/io.c \
|
---|
| 70 | generic/io/printf.c \
|
---|
| 71 | generic/io/klog.c \
|
---|
| 72 | generic/io/snprintf.c \
|
---|
| 73 | generic/io/vprintf.c \
|
---|
| 74 | generic/io/vsnprintf.c \
|
---|
| 75 | generic/io/printf_core.c \
|
---|
| 76 | generic/io/console.c \
|
---|
| 77 | generic/malloc.c \
|
---|
| 78 | generic/sysinfo.c \
|
---|
| 79 | generic/ipc.c \
|
---|
| 80 | generic/async.c \
|
---|
| 81 | generic/loader.c \
|
---|
| 82 | generic/getopt.c \
|
---|
| 83 | generic/adt/list.o \
|
---|
| 84 | generic/adt/hash_table.o \
|
---|
| 85 | generic/time.c \
|
---|
| 86 | generic/err.c \
|
---|
| 87 | generic/stdlib.c \
|
---|
| 88 | generic/mman.c \
|
---|
| 89 | generic/udebug.c \
|
---|
| 90 | generic/vfs/vfs.c \
|
---|
| 91 | generic/vfs/canonify.c \
|
---|
| 92 | generic/stacktrace.c
|
---|
| 93 |
|
---|
| 94 | SOURCES = \
|
---|
| 95 | $(GENERIC_SOURCES) \
|
---|
| 96 | $(ARCH_SOURCES)
|
---|
| 97 |
|
---|
[1b1164e8] | 98 | include $(USPACE_PREFIX)/Makefile.common
|
---|
[079f440] | 99 |
|
---|
| 100 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
---|
| 101 | ln -sfn kernel/arch $@
|
---|
| 102 |
|
---|
| 103 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
---|
| 104 | ln -sfn ../$< $@
|
---|
| 105 |
|
---|
| 106 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
---|
| 107 |
|
---|
| 108 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
---|
| 109 | ln -sfn ../$< $@
|
---|
| 110 |
|
---|
[1b1164e8] | 111 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
---|
| 112 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
---|