Draft: lab 5 failed

This commit is contained in:
2025-05-03 20:45:34 +08:00
parent 981cae803b
commit e73f90395d
39 changed files with 588 additions and 429 deletions

View File

@@ -13,6 +13,8 @@ LD := $(GNU)-ld
LDFLAGS += -g -nostdlib -no-pie
OBJCOPY := $(GNU)-objcopy
INCLUDE := -I../include -Iinclude
LD_SCRIPT := linker.ld
SRCS := $(shell find . -name '*.[cS]')
OBJS := $(SRCS:%=%.o)
@@ -29,11 +31,11 @@ userprog.elf: $(LD_SCRIPT) $(OBJS)
%.S.o: %.S
mkdir -p $(dir $@)
$(CC) -c $< -o $@ $(CCFLAGS)
$(CC) -c $< -o $@ $(INCLUDE) $(CCFLAGS)
%.c.o: %.c
mkdir -p $(dir $@)
$(CC) -c $< -o $@ $(CCFLAGS)
$(CC) -c $< -o $@ $(INCLUDE) $(CCFLAGS)
clean:
-rm $(OBJS) userprog userprog.elf