Added ability to load an arbitrary binary from an ethernet server and launch it
[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 \
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 --end-group
15
16 USER_APPS_PARLIB_LDOBJS    := $(OBJDIR)/$(USER_PARLIB_DIR)/entry.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_APPS_PARLIB_DIR)/%.o       
29
30 USER_APPS_PARLIB_GCC_LIB   := $(GCC_LIB)
31
32 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%.o: $(USER_APPS_PARLIB_DIR)/%.c
33         @echo + cc [APPS PARLIB] $<
34         @mkdir -p $(@D)
35         $(V)$(CC) $(USER_APPS_PARLIB_CFLAGS) -c -o $@ $<
36
37 $(OBJDIR)/$(USER_APPS_PARLIB_DIR)/%: $(USER_APPS_PARLIB_LDDEPENDS)
38         @echo + ld [APPS PARLIB] $@
39         $(V)$(LD) -o $@ $(USER_APPS_PARLIB_LDFLAGS) $@.o \
40                     $(USER_APPS_PARLIB_LDOBJS) $(USER_APPS_PARLIB_LDDIRS) \
41                     $(USER_APPS_PARLIB_LDLIBS) $(USER_APPS_PARLIB_GCC_LIB)
42         $(V)$(OBJDUMP) -S $@ > $@.asm
43         $(V)$(NM) -n $@ > $@.sym
44