summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2024-02-19 14:10:32 +0800
committerMole Shang <[email protected]>2024-02-19 14:36:21 +0800
commitd86118fc80267649b4791c8c0c72ebd60edf1ef2 (patch)
treeb792b617b4df80a5803a9c1164d0e3fdfe9cfe31 /Makefile
parentb20ef9d0210fd7d9403acde1857eed1b9880c0b2 (diff)
parent0cf897cbe05fd8485162619db4244f4159d0eb52 (diff)
downloadxv6-labs-d86118fc80267649b4791c8c0c72ebd60edf1ef2.tar.gz
xv6-labs-d86118fc80267649b4791c8c0c72ebd60edf1ef2.tar.bz2
xv6-labs-d86118fc80267649b4791c8c0c72ebd60edf1ef2.zip
Merge branch 'fs' into mmap
Conflicts: .gitignore Makefile conf/lab.mk kernel/defs.h user/user.h
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 20 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index 8e74f52..4c3d16a 100644
--- a/Makefile
+++ b/Makefile
@@ -13,12 +13,14 @@ OBJS = \
$K/kalloc.o \
$K/string.o \
$K/main.o \
+ $K/cow.o \
$K/vm.o \
$K/proc.o \
$K/swtch.o \
$K/trampoline.o \
$K/trap.o \
$K/syscall.o \
+ $K/sysinfo.o \
$K/sysproc.o \
$K/bio.o \
$K/fs.o \
@@ -44,20 +46,16 @@ OBJS_KCSAN += \
$K/kcsan.o
endif
-ifeq ($(LAB),lock)
OBJS += \
$K/stats.o\
$K/sprintf.o
-endif
-ifeq ($(LAB),net)
OBJS += \
$K/e1000.o \
$K/net.o \
$K/sysnet.o \
$K/pci.o
-endif
# riscv64-unknown-elf- or riscv64-linux-gnu-
@@ -90,7 +88,7 @@ CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2
ifdef LAB
LABUPPER = $(shell echo $(LAB) | tr a-z A-Z)
-XCFLAGS += -DSOL_$(LABUPPER) -DLAB_$(LABUPPER)
+XCFLAGS += -DSOL_$(LABUPPER) -DLAB_$(LABUPPER) -DLAB_PGTBL -DLAB_NET -DLAB_LOCK
endif
CFLAGS += $(XCFLAGS)
@@ -100,9 +98,7 @@ CFLAGS += -ffreestanding -fno-common -nostdlib -mno-relax
CFLAGS += -I.
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
-ifeq ($(LAB),net)
CFLAGS += -DNET_TESTS_PORT=$(SERVERPORT)
-endif
ifdef KCSAN
CFLAGS += -DKCSAN
@@ -141,9 +137,7 @@ tags: $(OBJS) _init
ULIB = $U/ulib.o $U/usys.o $U/printf.o $U/umalloc.o
-ifeq ($(LAB),lock)
ULIB += $U/statistics.o
-endif
_%: %.o $(ULIB)
$(LD) $(LDFLAGS) -T $U/user.ld -o $@ $^
@@ -188,30 +182,33 @@ UPROGS=\
$U/_grind\
$U/_wc\
$U/_zombie\
+ $U/_sleep\
+ $U/_pingpong\
+ $U/_primes\
+ $U/_find\
+ $U/_xargs\
+ $U/_trace\
+ $U/_sysinfotest\
+ $U/_symlinktest\
-ifeq ($(LAB),lock)
UPROGS += \
$U/_stats
-endif
-ifeq ($(LAB),traps)
UPROGS += \
$U/_call\
- $U/_bttest
-endif
+ $U/_bttest\
+ $U/_alarmtest
ifeq ($(LAB),lazy)
UPROGS += \
$U/_lazytests
endif
-ifeq ($(LAB),cow)
UPROGS += \
$U/_cowtest
-endif
ifeq ($(LAB),thread)
UPROGS += \
@@ -231,33 +228,23 @@ barrier: notxv6/barrier.c
gcc -o barrier -g -O2 $(XCFLAGS) notxv6/barrier.c -pthread
endif
-ifeq ($(LAB),pgtbl)
UPROGS += \
$U/_pgtbltest
-endif
-ifeq ($(LAB),lock)
UPROGS += \
$U/_kalloctest\
$U/_bcachetest
-endif
ifeq ($(LAB),fs)
UPROGS += \
$U/_bigfile
endif
-
-
-ifeq ($(LAB),net)
UPROGS += \
$U/_nettests
-endif
UEXTRA=
-ifeq ($(LAB),util)
- UEXTRA += user/xargstest.sh
-endif
+UEXTRA += user/xargstest.sh
fs.img: mkfs/mkfs README $(UEXTRA) $(UPROGS)
@@ -266,11 +253,13 @@ fs.img: mkfs/mkfs README $(UEXTRA) $(UPROGS)
-include kernel/*.d user/*.d
clean:
- rm -rf *.tex *.dvi *.idx *.aux *.log *.ind *.ilg *.dSYM *.zip *.pcap \
+ rm -f *.tex *.dvi *.idx *.aux *.log *.ind *.ilg *.dSYM *.zip \
*/*.o */*.d */*.asm */*.sym \
- $U/initcode $U/initcode.out $U/usys.S $U/_* \
- $K/kernel \
- mkfs/mkfs fs.img .gdbinit __pycache__ xv6.out* \
+ $U/initcode $U/initcode.out $K/kernel fs.img \
+ mkfs/mkfs .gdbinit \
+ $U/usys.S \
+ $(UPROGS) \
+ *.zip \
ph barrier
# try to generate a unique GDB port
@@ -293,10 +282,8 @@ QEMUOPTS += -global virtio-mmio.force-legacy=false
QEMUOPTS += -drive file=fs.img,if=none,format=raw,id=x0
QEMUOPTS += -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
-ifeq ($(LAB),net)
QEMUOPTS += -netdev user,id=net0,hostfwd=udp::$(FWDPORT)-:2000 -object filter-dump,id=net0,netdev=net0,file=packets.pcap
QEMUOPTS += -device e1000,netdev=net0,bus=pcie.0
-endif
qemu: $K/kernel fs.img
$(QEMU) $(QEMUOPTS)
@@ -308,7 +295,6 @@ qemu-gdb: $K/kernel .gdbinit fs.img
@echo "*** Now run 'gdb' in another window." 1>&2
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB)
-ifeq ($(LAB),net)
# try to generate a unique port for the echo server
SERVERPORT = $(shell expr `id -u` % 5000 + 25099)
@@ -317,7 +303,6 @@ server:
ping:
python3 ping.py $(FWDPORT)
-endif
##
## FOR testing lab grading script