Lab 1
This commit is contained in:
32
boot/Makefrag
Normal file
32
boot/Makefrag
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Makefile fragment for the JOS kernel.
|
||||
# This is NOT a complete makefile;
|
||||
# you must run GNU make in the top-level directory
|
||||
# where the GNUmakefile is located.
|
||||
#
|
||||
|
||||
OBJDIRS += boot
|
||||
|
||||
BOOT_OBJS := $(OBJDIR)/boot/boot.o $(OBJDIR)/boot/main.o
|
||||
|
||||
$(OBJDIR)/boot/%.o: boot/%.c
|
||||
@echo + cc -Os $<
|
||||
@mkdir -p $(@D)
|
||||
$(V)$(CC) -nostdinc $(KERN_CFLAGS) -Os -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/boot/%.o: boot/%.S
|
||||
@echo + as $<
|
||||
@mkdir -p $(@D)
|
||||
$(V)$(CC) -nostdinc $(KERN_CFLAGS) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/boot/main.o: boot/main.c
|
||||
@echo + cc -Os $<
|
||||
$(V)$(CC) -nostdinc $(KERN_CFLAGS) -Os -c -o $(OBJDIR)/boot/main.o boot/main.c
|
||||
|
||||
$(OBJDIR)/boot/boot: $(BOOT_OBJS)
|
||||
@echo + ld boot/boot
|
||||
$(V)$(LD) $(LDFLAGS) -N -e start -Ttext 0x7C00 -o $@.out $^
|
||||
$(V)$(OBJDUMP) -S $@.out >$@.asm
|
||||
$(V)$(OBJCOPY) -S -O binary -j .text $@.out $@
|
||||
$(V)perl boot/sign.pl $(OBJDIR)/boot/boot
|
||||
|
||||
Reference in New Issue
Block a user