source: mainline/uspace/lib/libc/Makefile.build@ 245e8399

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 245e8399 was cc1f8d4, checked in by Martin Decky <martin@…>, 16 years ago

proper support for parallel building (this time really tested)
all ports except sparc64 (which should follow soon)

  • Property mode set to 100644
File size: 3.6 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/devmap.c \
53 generic/event.c \
54 generic/errno.c \
55 generic/mem.c \
56 generic/string.c \
57 generic/fibril.c \
58 generic/fibril_sync.c \
59 generic/pcb.c \
60 generic/smc.c \
61 generic/thread.c \
62 generic/tls.c \
63 generic/task.c \
64 generic/futex.c \
65 generic/io/asprintf.c \
66 generic/io/io.c \
67 generic/io/printf.c \
68 generic/io/klog.c \
69 generic/io/snprintf.c \
70 generic/io/vprintf.c \
71 generic/io/vsnprintf.c \
72 generic/io/printf_core.c \
73 generic/io/console.c \
74 generic/malloc.c \
75 generic/sysinfo.c \
76 generic/ipc.c \
77 generic/async.c \
78 generic/loader.c \
79 generic/getopt.c \
80 generic/adt/list.o \
81 generic/adt/hash_table.o \
82 generic/time.c \
83 generic/err.c \
84 generic/stdlib.c \
85 generic/mman.c \
86 generic/udebug.c \
87 generic/vfs/vfs.c \
88 generic/vfs/canonify.c
89
90ARCH_SOURCES += \
91 arch/$(UARCH)/src/entry.s \
92 arch/$(UARCH)/src/thread_entry.s
93
94GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
95ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
96OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
97
98.PHONY: all
99
100all: $(LIBC) $(LINK)
101
102-include $(DEPEND)
103
104$(LIBC): $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
105 $(AR) rc $@ $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
106
107$(LINK): $(LINK).in
108 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
109
110%.o: %.S $(DEPEND)
111 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
112
113%.o: %.s $(DEPEND)
114 $(AS) $(AFLAGS) $< -o $@
115
116%.o: %.c $(DEPEND)
117 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
118
119$(DEPEND): $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
120 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
121 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
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 ../$< $@
Note: See TracBrowser for help on using the repository browser.