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