Line | |
---|
1 | ############################################################################ |
---|
2 | # Makefile for the "mini-libc" library. # |
---|
3 | ############################################################################ |
---|
4 | |
---|
5 | -include ../../params-soft.mk |
---|
6 | |
---|
7 | ifeq ($(ARCH_NAME),) |
---|
8 | $(error Please define in ARCH_NAME parameter in params-soft.mk!) |
---|
9 | endif |
---|
10 | |
---|
11 | SRCS = ctype.c \ |
---|
12 | dirent.c \ |
---|
13 | fcntl.c \ |
---|
14 | mman.c \ |
---|
15 | signal.c \ |
---|
16 | stat.c \ |
---|
17 | stdio.c \ |
---|
18 | stdlib.c \ |
---|
19 | string.c \ |
---|
20 | strings.c \ |
---|
21 | time.c \ |
---|
22 | unistd.c \ |
---|
23 | wait.c |
---|
24 | |
---|
25 | OBJS = $(addprefix build/, $(SRCS:.c=.o)) \ |
---|
26 | $(HAL_ARCH)/build/core/hal_user.o |
---|
27 | |
---|
28 | INCLUDES = -I. \ |
---|
29 | -I$(LIBPTHREAD_PATH) \ |
---|
30 | -I$(LIBALMOSMKH_PATH) \ |
---|
31 | -I$(SHARED_INCLUDE) \ |
---|
32 | -I$(HAL)/generic \ |
---|
33 | -I$(HAL_ARCH)/core \ |
---|
34 | -I$(KERNEL) |
---|
35 | |
---|
36 | libs : build/lib/libc.a headers |
---|
37 | |
---|
38 | build : |
---|
39 | @mkdir build |
---|
40 | @mkdir build/lib |
---|
41 | @mkdir build/include |
---|
42 | @mkdir build/include/sys |
---|
43 | |
---|
44 | $(HAL_ARCH)/build/core/hal_user.o : |
---|
45 | $(MAKE) -C $(HAL_ARCH) |
---|
46 | |
---|
47 | build/%.o : %.c %.h |
---|
48 | $(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $< |
---|
49 | $(DU) -D $@ > $@.txt |
---|
50 | |
---|
51 | headers: build |
---|
52 | cp ctype.h build/include/. |
---|
53 | cp dirent.h build/include/. |
---|
54 | cp fcntl.h build/include/. |
---|
55 | cp mman.h build/include/sys/. |
---|
56 | cp signal.h build/include/. |
---|
57 | cp stat.h build/include/sys/. |
---|
58 | cp stdio.h build/include/. |
---|
59 | cp stdlib.h build/include/. |
---|
60 | cp string.h build/include/. |
---|
61 | cp strings.h build/include/. |
---|
62 | cp time.h build/include/. |
---|
63 | cp unistd.h build/include/. |
---|
64 | cp wait.h build/include/sys/. |
---|
65 | |
---|
66 | build/lib/libc.a: build $(OBJS) |
---|
67 | $(AR) rc $@ $(OBJS) |
---|
68 | $(RANLIB) $@ |
---|
69 | |
---|
70 | .PHONY = build clean headers |
---|
71 | |
---|
72 | clean: |
---|
73 | rm -rf build/ |
---|
Note: See
TracBrowser
for help on using the repository browser.