3672491ebea626a208d9b8a833099e9aa0c0c2c4
[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) --nodeputy --nopatch \
5                               -I$(USER_PARLIB_NEWLIB_DIR)/include \
6                               -I$(USER_PARLIB_DIR)/inc
7
8 USER_APPS_PARLIB_LDFLAGS   := $(USER_LDFLAGS) -static \
9                               -T $(USER_APPS_PARLIB_DIR)/apps.ld
10
11 USER_APPS_PARLIB_LDDIRS    := -L$(OBJDIR)/$(USER_PARLIB_DIR) \
12                               -L$(USER_PARLIB_NEWLIB_DIR)/lib
13
14 USER_APPS_PARLIB_LDLIBS    := --start-group -lc -lm -lg -lparlib -livyparlib --end-group
15
16 USER_APPS_PARLIB_LDOBJS    := $(OBJDIR)/$(USER_PARLIB_DIR)/entry_$(TARGET_ARCH).o \
17                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/readline.o \
18                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_io.o \
19                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/file_error.o \
20                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/clrscrn.o \
21                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/draw_nanwan.o \
22                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/run_binary.o \
23                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/change_user.o  
24
25
26 USER_APPS_PARLIB_LDDEPENDS := $(USER_APPS_PARLIB_LDOBJS) \
27                               $(OBJDIR)/$(USER_PARLIB_DIR)/libparlib.a \
28                               $(OBJDIR)/$(USER_PARLIB_DIR)/libivyparlib.a \
29                               $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o       
30
31 USER_APPS_PARLIB_GCC_LIB   := $(GCC_LIB)
32
33 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o: $(USER_APPS_PARLIB_DIR)/%.c
34         @echo + cc [APPS PARLIB] $<
35         @mkdir -p $(@D)
36         $(V)$(CC) $(USER_APPS_PARLIB_CFLAGS) -c -o $@ $<
37
38 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%: $(USER_APPS_PARLIB_LDDEPENDS)
39         @echo + ld [APPS PARLIB] $@
40         $(V)$(LD) -o $@ $(USER_APPS_PARLIB_LDFLAGS) $@.o \
41                     $(USER_APPS_PARLIB_LDOBJS) $(USER_APPS_PARLIB_LDDIRS) \
42                     $(USER_APPS_PARLIB_LDLIBS) $(USER_APPS_PARLIB_GCC_LIB)
43         $(V)$(OBJDUMP) -S $@ > $@.asm
44         $(V)$(NM) -n $@ > $@.sym
45