Lab3 initial merge
[akaros.git] / lib / Makefrag
1 OBJDIRS += lib
2
3 LIB_SRCFILES :=         lib/console.c \
4                         lib/libmain.c \
5                         lib/exit.c \
6                         lib/panic.c \
7                         lib/printf.c \
8                         lib/printfmt.c \
9                         lib/readline.c \
10                         lib/string.c \
11                         lib/syscall.c
12
13
14
15
16 LIB_OBJFILES := $(patsubst lib/%.c, $(OBJDIR)/lib/%.o, $(LIB_SRCFILES))
17 LIB_OBJFILES := $(patsubst lib/%.S, $(OBJDIR)/lib/%.o, $(LIB_OBJFILES))
18
19 $(OBJDIR)/lib/%.o: lib/%.c
20         @echo + cc[USER] $<
21         @mkdir -p $(@D)
22         $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
23
24 $(OBJDIR)/lib/%.o: lib/%.S
25         @echo + as[USER] $<
26         @mkdir -p $(@D)
27         $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
28
29 $(OBJDIR)/lib/libjos.a: $(LIB_OBJFILES)
30         @echo + ar $@
31         $(V)$(AR) r $@ $(LIB_OBJFILES)