18 lines
589 B
Plaintext
18 lines
589 B
Plaintext
OBJDIRS += user
|
|
|
|
|
|
USERLIBS += jos
|
|
|
|
$(OBJDIR)/user/%.o: user/%.c $(OBJDIR)/.vars.USER_CFLAGS
|
|
@echo + cc[USER] $<
|
|
@mkdir -p $(@D)
|
|
$(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
|
|
|
|
$(OBJDIR)/user/%: $(OBJDIR)/user/%.o $(OBJDIR)/lib/entry.o $(USERLIBS:%=$(OBJDIR)/lib/lib%.a) user/user.ld
|
|
@echo + ld $@
|
|
$(V)$(LD) -o $@.debug $(ULDFLAGS) $(LDFLAGS) -nostdlib $(OBJDIR)/lib/entry.o $@.o -L$(OBJDIR)/lib $(USERLIBS:%=-l%) $(GCC_LIB)
|
|
$(V)$(OBJDUMP) -S $@.debug > $@.asm
|
|
$(V)$(NM) -n $@.debug > $@.sym
|
|
$(V)$(OBJCOPY) -R .stab -R .stabstr --add-gnu-debuglink=$(basename $@.debug) $@.debug $@
|
|
|