summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 22 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 8e74f52..a4e961a 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,18 @@ OBJS_KCSAN += \
$K/kcsan.o
endif
-ifeq ($(LAB),lock)
+ifeq ($(LAB),$(filter $(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 +90,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
endif
CFLAGS += $(XCFLAGS)
@@ -100,9 +100,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,7 +139,7 @@ tags: $(OBJS) _init
ULIB = $U/ulib.o $U/usys.o $U/printf.o $U/umalloc.o
-ifeq ($(LAB),lock)
+ifeq ($(LAB),$(filter $(LAB), lock))
ULIB += $U/statistics.o
endif
@@ -188,30 +186,34 @@ UPROGS=\
$U/_grind\
$U/_wc\
$U/_zombie\
+ $U/_sleep\
+ $U/_pingpong\
+ $U/_primes\
+ $U/_find\
+ $U/_xargs\
+ $U/_trace\
+ $U/_sysinfotest\
-ifeq ($(LAB),lock)
+ifeq ($(LAB),$(filter $(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,10 +233,8 @@ 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 += \
@@ -248,16 +248,11 @@ UPROGS += \
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 +261,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 +290,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 +303,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 +311,6 @@ server:
ping:
python3 ping.py $(FWDPORT)
-endif
##
## FOR testing lab grading script