source: mainline/uspace/lib/libc/Makefile.build@ c83d2b4

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since c83d2b4 was 2c34be8, checked in by Jakub Jermar <jakub@…>, 16 years ago

Add simple framework for stack traces in userspace.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1#
2# Copyright (c) 2005 Martin Decky
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
29## Common compiler flags
30#
31
32LIBC_PREFIX = $(shell pwd)
33SOFTINT_PREFIX = ../softint
34LINK = arch/$(UARCH)/_link.ld
35
36
37## Setup toolchain
38#
39
40include Makefile.common
41include Makefile.toolchain
42
43
44## Sources
45#
46
47GENERIC_SOURCES = \
48 generic/libc.c \
49 generic/ddi.c \
50 generic/as.c \
51 generic/cap.c \
52 generic/clipboard.c \
53 generic/devmap.c \
54 generic/event.c \
55 generic/errno.c \
56 generic/mem.c \
57 generic/string.c \
58 generic/fibril.c \
59 generic/fibril_synch.c \
60 generic/pcb.c \
61 generic/smc.c \
62 generic/thread.c \
63 generic/tls.c \
64 generic/task.c \
65 generic/futex.c \
66 generic/io/asprintf.c \
67 generic/io/io.c \
68 generic/io/printf.c \
69 generic/io/klog.c \
70 generic/io/snprintf.c \
71 generic/io/vprintf.c \
72 generic/io/vsnprintf.c \
73 generic/io/printf_core.c \
74 generic/io/console.c \
75 generic/malloc.c \
76 generic/sysinfo.c \
77 generic/ipc.c \
78 generic/async.c \
79 generic/loader.c \
80 generic/getopt.c \
81 generic/adt/list.o \
82 generic/adt/hash_table.o \
83 generic/time.c \
84 generic/err.c \
85 generic/stdlib.c \
86 generic/mman.c \
87 generic/udebug.c \
88 generic/vfs/vfs.c \
89 generic/vfs/canonify.c \
90 generic/stacktrace.c
91
92ARCH_SOURCES += \
93 arch/$(UARCH)/src/entry.s \
94 arch/$(UARCH)/src/thread_entry.s
95
96GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
97ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
98OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
99
100.PHONY: all
101
102all: $(LIBC) $(LINK)
103
104-include $(DEPEND)
105
106$(LIBC): $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
107 $(AR) rc $@ $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
108
109$(LINK): $(LINK).in
110 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
111
112%.o: %.S $(DEPEND)
113 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
114
115%.o: %.s $(DEPEND)
116 $(AS) $(AFLAGS) $< -o $@
117
118%.o: %.c $(DEPEND)
119 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
120
121$(DEPEND): $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
122 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
123 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
124
125$(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
126 ln -sfn kernel/arch $@
127
128$(INCLUDE_LIBARCH): arch/$(UARCH)/include
129 ln -sfn ../$< $@
130
131$(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
132
133$(INCLUDE_KERNEL): ../../../kernel/generic/include/
134 ln -sfn ../$< $@
Note: See TracBrowser for help on using the repository browser.