source: trunk/libs/mini-libc/Makefile @ 460

Last change on this file since 460 was 445, checked in by alain, 6 years ago

Restructure the mini_libc.

File size: 1.7 KB
RevLine 
[439]1############################################################################
[445]2#          Makefile for the "mini-libc" library.                           #
[439]3############################################################################
4
5-include ../../params-soft.mk
[445]6
[439]7ifeq ($(ARCH_NAME),)
8$(error Please define in ARCH_NAME parameter in params-soft.mk!)
9endif
10
[445]11SRCS = 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
[439]25OBJS = $(addprefix build/, $(SRCS:.c=.o)) \
26       $(HAL_ARCH)/build/core/hal_user.o
27
[445]28INCLUDES = -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) 
[439]35
[445]36libs : build/lib/libc.a  headers
[439]37
38build :
39        @mkdir build
40        @mkdir build/lib
41        @mkdir build/include
[444]42        @mkdir build/include/sys
[439]43
44$(HAL_ARCH)/build/core/hal_user.o :
45        $(MAKE) -C $(HAL_ARCH)
46
47build/%.o : %.c %.h
48        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
49        $(DU) -D $@ > $@.txt
50
[444]51headers: build
[445]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/.
[444]65
[439]66build/lib/libc.a: build $(OBJS)
67        $(AR) rc $@ $(OBJS)
[440]68        $(RANLIB) $@
[439]69
[444]70.PHONY = build clean headers
[439]71
72clean:
[444]73        rm -rf build/
Note: See TracBrowser for help on using the repository browser.