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/event.c \
|
---|
60 | generic/errno.c \
|
---|
61 | generic/mem.c \
|
---|
62 | generic/str.c \
|
---|
63 | generic/str_error.c \
|
---|
64 | generic/fibril.c \
|
---|
65 | generic/fibril_synch.c \
|
---|
66 | generic/pcb.c \
|
---|
67 | generic/smc.c \
|
---|
68 | generic/thread.c \
|
---|
69 | generic/tls.c \
|
---|
70 | generic/task.c \
|
---|
71 | generic/futex.c \
|
---|
72 | generic/io/asprintf.c \
|
---|
73 | generic/io/io.c \
|
---|
74 | generic/io/printf.c \
|
---|
75 | generic/io/klog.c \
|
---|
76 | generic/io/snprintf.c \
|
---|
77 | generic/io/vprintf.c \
|
---|
78 | generic/io/vsnprintf.c \
|
---|
79 | generic/io/printf_core.c \
|
---|
80 | generic/io/console.c \
|
---|
81 | generic/malloc.c \
|
---|
82 | generic/sysinfo.c \
|
---|
83 | generic/ipc.c \
|
---|
84 | generic/async.c \
|
---|
85 | generic/loader.c \
|
---|
86 | generic/getopt.c \
|
---|
87 | generic/adt/list.o \
|
---|
88 | generic/adt/hash_table.o \
|
---|
89 | generic/time.c \
|
---|
90 | generic/err.c \
|
---|
91 | generic/stdlib.c \
|
---|
92 | generic/mman.c \
|
---|
93 | generic/udebug.c \
|
---|
94 | generic/vfs/vfs.c \
|
---|
95 | generic/vfs/canonify.c \
|
---|
96 | generic/stacktrace.c \
|
---|
97 | generic/arg_parse.c \
|
---|
98 | generic/ps.c \
|
---|
99 | generic/cpuinfo.c \
|
---|
100 | generic/meminfo.c \
|
---|
101 | generic/load.c \
|
---|
102 | generic/uptime.c
|
---|
103 |
|
---|
104 | SOURCES = \
|
---|
105 | $(GENERIC_SOURCES) \
|
---|
106 | $(ARCH_SOURCES)
|
---|
107 |
|
---|
108 | include $(USPACE_PREFIX)/Makefile.common
|
---|
109 |
|
---|
110 | $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
|
---|
111 | ln -sfn kernel/arch $@
|
---|
112 |
|
---|
113 | $(INCLUDE_LIBARCH): arch/$(UARCH)/include
|
---|
114 | ln -sfn ../$< $@
|
---|
115 |
|
---|
116 | $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
|
---|
117 |
|
---|
118 | $(INCLUDE_KERNEL): ../../../kernel/generic/include/
|
---|
119 | ln -sfn ../$< $@
|
---|
120 |
|
---|
121 | $(LINKER_SCRIPT): $(LINKER_SCRIPT).in
|
---|
122 | $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
|
---|
123 |
|
---|
124 | $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
|
---|
125 | ln -sfn ../../../$< $@
|
---|