Another round at reorganization
[akaros.git] / user / apps / parlib / Makefrag
1 USER_APPS_PARLIB_DIR = $(USER_APPS_DIR)/parlib
2 OBJDIRS += $(USER_APPS_PARLIB_DIR)
3
4 USER_APPS_PARLIB_CFLAGS    := $(USER_CFLAGS) \
5                               -I$(USER_NEWLIB_DIR)/include
6
7 USER_APPS_PARLIB_LDFLAGS   := $(USER_LDFLAGS) -static \
8                               -T $(USER_APPS_PARLIB_DIR)/apps.ld
9
10 USER_APPS_PARLIB_LDDIRS    := -L$(OBJDIR)/$(USER_PARLIB_DIR) \
11                               -L$(OBJDIR)/$(USER_ROSLIB_DIR) \
12                               -L$(USER_NEWLIB_DIR)/lib
13
14 USER_APPS_PARLIB_LDLIBS    := -lc -lm -lg -lparlib -lroslib
15
16 USER_APPS_PARLIB_LDOBJS    := $(OBJDIR)/$(USER_ROSLIB_DIR)/entry.o \
17                               $(OBJDIR)/$(USER_ROSLIB_DIR)/libmain.o
18
19 USER_APPS_PARLIB_LDDEPENDS := $(USER_APPS_PARLIB_LDOBJS) \
20                               $(OBJDIR)/$(USER_PARLIB_DIR)/libparlib.a \
21                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o       
22
23 USER_APPS_PARLIB_GCC_LIB   := $(GCC_LIB)
24
25 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o: $(USER_APPS_PARLIB_DIR)/%.c
26         @echo + cc [APPS PARLIB] $<
27         @mkdir -p $(@D)
28         $(V)$(CC) $(USER_APPS_PARLIB_CFLAGS) -c -o $@ $<
29
30 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%: $(USER_APPS_PARLIB_LDDEPENDS)
31         @echo + ld [APPS PARLIB] $@
32         $(V)$(LD) -o $@ $(USER_APPS_PARLIB_LDFLAGS) $@.o \
33                     $(USER_APPS_PARLIB_LDOBJS) $(USER_APPS_PARLIB_LDDIRS) \
34                     $(USER_APPS_PARLIB_LDLIBS) $(USER_APPS_PARLIB_GCC_LIB)
35         $(V)$(OBJDUMP) -S $@ > $@.asm
36         $(V)$(NM) -n $@ > $@.sym
37