Added more syscalls
[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_PARLIB_DIR)/inc
6                               # -I$(USER_PARLIB_NEWLIB_DIR)/include
7 ifeq ($(COMPILER),IVY)
8         PATCHFILE = $(OBJDIR)/$(USER_PARLIB_DIR)/libc_patch.i
9         USER_APPS_PARLIB_CFLAGS    += --nodeputy --nopatch #--patch=$(PATCHFILE) 
10 endif
11
12 USER_APPS_PARLIB_LDFLAGS   := -static \
13                               -T $(USER_APPS_PARLIB_DIR)/apps_$(TARGET_ARCH).ld
14
15 USER_APPS_PARLIB_LDDIRS    := -L$(OBJDIR)/$(USER_PARLIB_DIR)
16
17 USER_APPS_PARLIB_LDLIBS    := --start-group -lc -lm -lg -lparlib -lpthread \
18                               -livyparlib --end-group
19
20 USER_APPS_PARLIB_LDOBJS    := \
21                               $(OBJDIR)/$(USER_PARLIB_ARCH_SRC_DIR)/entry.o \
22                               $(OBJDIR)/$(USER_PARLIB_ARCH_SRC_DIR)/crtbegin.o \
23                               $(OBJDIR)/$(USER_PARLIB_ARCH_SRC_DIR)/crtend.o \
24                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/readline.o \
25                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_io.o \
26                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_error.o \
27                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/clrscrn.o \
28                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/draw_nanwan.o \
29                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/run_binary.o \
30                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/run_binary_colored.o \
31                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/change_user.o  
32
33
34 USER_APPS_PARLIB_LDDEPENDS := $(USER_APPS_PARLIB_LDOBJS) \
35                               $(OBJDIR)/$(USER_PARLIB_DIR)/libparlib.a \
36                               $(OBJDIR)/$(USER_PARLIB_DIR)/libpthread.a \
37                               $(OBJDIR)/$(USER_PARLIB_DIR)/libivyparlib.a \
38                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o
39
40 USER_APPS_PARLIB_GCC_LIB   := $(GCC_LIB)
41
42 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o: $(USER_APPS_PARLIB_DIR)/%.c $(PATCHFILE)
43         @echo + cc [APPS PARLIB] $<
44         @mkdir -p $(@D)
45         $(V)$(CC) $(USER_APPS_PARLIB_CFLAGS) -c -o $@ $<
46
47 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%: $(USER_APPS_PARLIB_LDDEPENDS)
48         @echo + ld [APPS PARLIB] $@
49         $(V)$(LD) -o $@ $(USER_APPS_PARLIB_LDFLAGS) $@.o \
50                     $(USER_APPS_PARLIB_LDOBJS) $(USER_APPS_PARLIB_LDDIRS) \
51                     $(USER_APPS_PARLIB_LDLIBS) $(USER_APPS_PARLIB_GCC_LIB)
52         $(V)$(OBJDUMP) -S $@ > $@.asm
53         $(V)$(NM) -n $@ > $@.sym