Adding SharC annotations
[akaros.git] / user / apps / parlib / Makefrag
1 USER_APPS_PARLIB_DIR = $(USER_APPS_DIR)/parlib
2 OBJDIRS += $(USER_APPS_PARLIB_DIR)
3
4 PATCHFILE = $(OBJDIR)/$(USER_PARLIB_DIR)/libc_patch.i
5
6 USER_APPS_PARLIB_CFLAGS    := $(USER_CFLAGS)  \
7                               -I$(USER_PARLIB_NEWLIB_DIR)/include \
8                               -I$(USER_PARLIB_DIR)/inc
9 ifeq ($(COMPILER),IVY)
10         USER_APPS_PARLIB_CFLAGS    += --nodeputy --nopatch #--patch=$(PATCHFILE) 
11 endif
12
13 USER_APPS_PARLIB_LDFLAGS   := $(USER_LDFLAGS) -static \
14                               -T $(USER_APPS_PARLIB_DIR)/apps_$(TARGET_ARCH).ld
15
16 USER_APPS_PARLIB_LDDIRS    := -L$(OBJDIR)/$(USER_PARLIB_DIR) \
17                               -L$(USER_PARLIB_NEWLIB_DIR)/lib/$(TARGET_ARCH)
18
19 USER_APPS_PARLIB_LDLIBS    := --start-group -lc -lm -lg -lparlib -livyparlib --end-group
20
21 USER_APPS_PARLIB_LDOBJS    := $(OBJDIR)/$(USER_PARLIB_ARCH_SRC_DIR)/entry.o \
22                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/readline.o \
23                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_io.o \
24                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_error.o \
25                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/clrscrn.o \
26                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/draw_nanwan.o \
27                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/change_user.o  
28
29
30 USER_APPS_PARLIB_LDDEPENDS := $(USER_APPS_PARLIB_LDOBJS) \
31                               $(OBJDIR)/$(USER_PARLIB_DIR)/libparlib.a \
32                               $(OBJDIR)/$(USER_PARLIB_DIR)/libivyparlib.a \
33                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o       
34
35 USER_APPS_PARLIB_GCC_LIB   := $(GCC_LIB)
36
37 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o: $(USER_APPS_PARLIB_DIR)/%.c $(PATCHFILE)
38         @echo + cc [APPS PARLIB] $<
39         @mkdir -p $(@D)
40         $(V)$(CC) $(USER_APPS_PARLIB_CFLAGS) -c -o $@ $<
41
42 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%: $(USER_APPS_PARLIB_LDDEPENDS)
43         @echo + ld [APPS PARLIB] $@
44         $(V)$(LD) -o $@ $(USER_APPS_PARLIB_LDFLAGS) $@.o \
45                     $(USER_APPS_PARLIB_LDOBJS) $(USER_APPS_PARLIB_LDDIRS) \
46                     $(USER_APPS_PARLIB_LDLIBS) $(USER_APPS_PARLIB_GCC_LIB)
47         $(V)$(OBJDUMP) -S $@ > $@.asm
48         $(V)$(NM) -n $@ > $@.sym
49