Skip to content

Commit

Permalink
add "make qemu" to make it easy to use
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Jul 2, 2019
1 parent 38e93ba commit 2a8f533
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ dep/
*.bin
*.ub
boot/loader
*.d
tools/mksfs
.gdb_history
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,21 @@ BUILD_DIR += $(USER_OBJDIR)

DEPENDS := $(patsubst $(SRCDIR)/%.c, $(DEPDIR)/%.d, $(SRC))

.PHONY: all checkdirs clean

CONFIG_FILE := .config_$(ON_FPGA)_$(EN_INT)_$(EN_TLB)

.PHONY: all checkdirs clean qemu

all: checkdirs boot/loader.bin obj/ucore-kernel-initrd

$(shell mkdir -p $(DEP_DIR))

$(CONFIG_FILE):
@rm -f .config_*
touch $@

qemu: obj/ucore-kernel-initrd
qemu-system-mipsel -M mipssim -m 32M -nographic -kernel $< -monitor none -serial stdio

obj/ucore-kernel: $(OBJ) tools/kernel.ld
@echo LINK $@
Expand All @@ -99,15 +108,15 @@ obj/ucore-kernel-piggy: $(BUILD_DIR) $(OBJ) $(USER_APP_BINS) tools/kernel.ld
$(LD) $(LDFLAGS_SCRIPT) $(OBJ) \
$(addsuffix .piggy.o, $(USER_APP_BINS)) -o $@

$(DEPDIR)/%.d: $(SRCDIR)/%.c
$(DEPDIR)/%.d: $(SRCDIR)/%.c $(CONFIG_FILE)
@echo DEP $<
@set -e; rm -f $@; \
$(CC) -MM -MT "$(OBJDIR)/$*.o $@" $(CFLAGS) $(INCLUDES) $< > $@;

$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(CONFIG_FILE)
$(CC) -c -mips1 $(INCLUDES) $(CFLAGS) $(MACH_DEF) $< -o $@

$(OBJDIR)/%.o: $(SRCDIR)/%.S
$(OBJDIR)/%.o: $(SRCDIR)/%.S $(CONFIG_FILE)
$(CC) -c -mips32 -D__ASSEMBLY__ $(MACH_DEF) $(INCLUDES) $(CFLAGS) $< -o $@

checkdirs: $(BUILD_DIR) $(DEP_DIR)
Expand Down
6 changes: 0 additions & 6 deletions debug

This file was deleted.

4 changes: 0 additions & 4 deletions run

This file was deleted.

0 comments on commit 2a8f533

Please sign in to comment.