Userspace atomics library
[akaros.git] / user / roslib / src / Makefrag
1 USER_ROSLIB_SRC_DIR = $(USER_ROSLIB_DIR)/src
2 OBJDIRS += $(USER_ROSLIB_SRC_DIR)
3
4 USER_ROSLIB_SRC_CFLAGS   := $(USER_CFLAGS) -nostdinc \
5                             -I$(USER_ROSLIB_INCLUDE_DIR)
6
7 USER_ROSLIB_SRC_SRCFILES := $(USER_ROSLIB_SRC_DIR)/console.c \
8                             $(USER_ROSLIB_SRC_DIR)/libmain.c \
9                             $(USER_ROSLIB_SRC_DIR)/null.c \
10                             $(USER_ROSLIB_SRC_DIR)/exit.c \
11                             $(USER_ROSLIB_SRC_DIR)/panic.c \
12                             $(USER_ROSLIB_SRC_DIR)/printf.c \
13                             $(USER_ROSLIB_SRC_DIR)/printfmt.c \
14                             $(USER_ROSLIB_SRC_DIR)/readline.c \
15                             $(USER_ROSLIB_SRC_DIR)/string.c \
16                             $(USER_ROSLIB_SRC_DIR)/syscall.c \
17                             $(USER_ROSLIB_SRC_DIR)/asynccall.c \
18                             $(USER_ROSLIB_SRC_DIR)/atomic.c \
19                             $(USER_ROSLIB_SRC_DIR)/timer.c 
20
21 USER_ROSLIB_SRC_OBJFILES := $(patsubst $(USER_ROSLIB_SRC_DIR)/%.c, \
22                             $(OBJDIR)/$(USER_ROSLIB_DIR)/%.o,  \
23                             $(USER_ROSLIB_SRC_SRCFILES))
24 USER_ROSLIB_SRC_OBJFILES := $(patsubst $(USER_ROSLIB_SRC_DIR)/%.S, \
25                             $(OBJDIR)/$(USER_ROSLIB_DIR)/%.o,  \
26                             $(USER_ROSLIB_SRC_OBJFILES))
27
28 $(OBJDIR)/$(USER_ROSLIB_DIR)/%.o: $(USER_ROSLIB_SRC_DIR)/%.c
29         @echo + cc [ROSLIB] $<
30         @mkdir -p $(@D)
31         $(V)$(CC) $(USER_ROSLIB_SRC_CFLAGS) -c -o $@ $<
32
33 $(OBJDIR)/$(USER_ROSLIB_DIR)/%.o: $(USER_ROSLIB_SRC_DIR)/%.S
34         @echo + as [ROSLIB] $<
35         @mkdir -p $(@D)
36         $(V)$(CC) $(USER_ROSLIB_SRC_CFLAGS) -c -o $@ $<
37
38 $(OBJDIR)/$(USER_ROSLIB_DIR)/libroslib.a: $(USER_ROSLIB_SRC_OBJFILES)
39         @echo + ar [ROSLIB] $@
40         $(V)$(AR) r $@ $(USER_ROSLIB_SRC_OBJFILES) 2>/dev/null
41