Track user and kernel time per thread.
[newos.git] / lib / nulibc / nulibc.mk
blob0f9846dd11bce589db4ab4e429f3d3d4fd2991a3
1 NULIBC_DIR = $(LIB_DIR)/nulibc
2 NULIBC_OBJ_DIR = $(NULIBC_DIR)/$(OBJ_DIR)
5 include $(NULIBC_DIR)/hoard/nulibc_hoard.mk
6 include $(NULIBC_DIR)/locale/nulibc_locale.mk
7 include $(NULIBC_DIR)/stdio/nulibc_stdio.mk
8 include $(NULIBC_DIR)/stdlib/nulibc_stdlib.mk
9 include $(NULIBC_DIR)/string/nulibc_string.mk
10 include $(NULIBC_DIR)/system/nulibc_system.mk
11 include $(NULIBC_DIR)/unistd/nulibc_unistd.mk
13 CFLAGS +=
15 NULIBC_OBJS = \
16 $(NULIBC_OBJ_DIR)/nulibc_init.o \
17 $(NULIBC_HOARD_OBJS) \
18 $(NULIBC_LOCALE_OBJS) \
19 $(NULIBC_STDIO_OBJS) \
20 $(NULIBC_STDLIB_OBJS) \
21 $(NULIBC_STRING_OBJS) \
22 $(NULIBC_SYSTEM_OBJS) \
23 $(NULIBC_UNISTD_OBJS)
25 DEPS += $(NULIBC_OBJS:.o=.d)
27 NULIBC= $(NULIBC_STATIC) $(NULIBC_DYNAMIC)
28 NULIBC_STATIC = $(NULIBC_OBJ_DIR)/libc.a
29 NULIBC_DYNAMIC = $(NULIBC_OBJ_DIR)/libc.so
31 $(NULIBC_STATIC): $(NULIBC_OBJS)
32 @mkdir -p $(NULIBC_OBJ_DIR)
33 $(AR) r $@ $^
35 $(NULIBC_DYNAMIC): $(LIBGLUE) $(NULIBC_OBJS)
36 @mkdir -p $(NULIBC_OBJ_DIR)
37 $(LD) -shared -soname libc.so --script=$(LIBS_LDSCRIPT) -o$@ $^
39 LIBS += $(NULIBC_DYNAMIC)
40 LINK_LIBS += -Bdynamic $(NULIBC_DYNAMIC)
41 KLIBS += $(NULIBC_STATIC)
42 LINK_KLIBS += -static $(NULIBC_STATIC)
44 nulibcclean:
45 rm -f $(NULIBC_OBJS) $(NULIBC_STATIC) $(NULIBC_DYNAMIC)
47 LIBS_CLEAN += nulibcclean
49 # build prototypes
50 $(NULIBC_OBJ_DIR)/%.o: $(NULIBC_DIR)/%.c
51 @if [ ! -d $(NULIBC_OBJ_DIR) ]; then mkdir -p $(NULIBC_OBJ_DIR); fi
52 $(CC) -c $< $(GLOBAL_CFLAGS) -Iinclude -Iinclude/nulibc -o $@
54 $(NULIBC_OBJ_DIR)/%.d: $(NULIBC_DIR)/%.c
55 @if [ ! -d $(NULIBC_OBJ_DIR) ]; then mkdir -p $(NULIBC_OBJ_DIR); fi
56 @echo "making deps for $<..."
57 @($(ECHO) -n $(dir $@); $(CC) $(GLOBAL_CFLAGS) -Iinclude -Iinclude/nulibc -M -MG $<) > $@
59 $(NULIBC_OBJ_DIR)/%.d: $(NULIBC_DIR)/%.S
60 @if [ ! -d $(NULIBC_OBJ_DIR) ]; then mkdir -p $(NULIBC_OBJ_DIR); fi
61 @echo "making deps for $<..."
62 @($(ECHO) -n $(dir $@);$(CC) $(GLOBAL_CFLAGS) -Iinclude -Iinclude/nulibc -M -MG $<) > $@
64 $(NULIBC_OBJ_DIR)/%.o: $(NULIBC_DIR)/%.S
65 @if [ ! -d $(NULIBC_OBJ_DIR) ]; then mkdir -p $(NULIBC_OBJ_DIR); fi
66 $(CC) -c $< $(GLOBAL_CFLAGS) -Iinclude -Iinclude/nulibc -o $@