Merged the timing and measurement stuff together and cleaned it up a bit
[akaros.git] / lib / Makefrag
1 NATIVECC := ivycc
2
3 OBJDIRS += lib
4
5 LIB_SRCFILES :=         lib/console.c \
6                         lib/libmain.c \
7                         lib/null.c \
8                         lib/exit.c \
9                         lib/panic.c \
10                         lib/printf.c \
11                         lib/printfmt.c \
12                         lib/readline.c \
13                         lib/string.c \
14                         lib/syscall.c \
15                         lib/asynccall.c \
16                         lib/timer.c
17
18
19
20
21 LIB_OBJFILES := $(patsubst lib/%.c, $(OBJDIR)/lib/%.o, $(LIB_SRCFILES))
22 LIB_OBJFILES := $(patsubst lib/%.S, $(OBJDIR)/lib/%.o, $(LIB_OBJFILES))
23
24 $(OBJDIR)/lib/%.o: lib/%.c
25         @echo + cc[USER] $<
26         @mkdir -p $(@D)
27         $(V)$(NATIVECC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
28
29 $(OBJDIR)/lib/%.o: lib/%.S
30         @echo + as[USER] $<
31         @mkdir -p $(@D)
32         $(V)$(NATIVECC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
33
34 $(OBJDIR)/lib/libros.a: $(LIB_OBJFILES)
35         @echo + ar $@
36         $(V)$(AR) r $@ $(LIB_OBJFILES)