Comment.
[pintos-anon] / grading / userprog / Makefile
index 25ba85759b7e0bbfab6354f8f4eb72adbd67950b..1eb67b3142af29a46f1591b25f1eea24f47bbc5e 100644 (file)
-SRCDIR = ../../src
+# This file is automatically generated from Make.base and Make.tests
+# by mkmf.  Do not modify!
+
+TESTS = \
+       args-argc args-argv0 args-argvn args-single args-multiple \
+       args-dbl-space sc-bad-sp sc-bad-arg sc-boundary halt exit \
+       create-normal create-empty create-null create-bad-ptr create-long \
+       create-exists create-bound open-normal open-missing open-boundary \
+       open-empty open-null open-bad-ptr open-twice close-normal \
+       close-twice close-stdin close-stdout close-bad-fd read-normal \
+       read-bad-ptr read-boundary read-zero read-stdout read-bad-fd \
+       write-normal write-bad-ptr write-boundary write-zero write-stdin \
+       write-bad-fd exec-once exec-arg exec-multiple exec-missing \
+       exec-bad-ptr join-simple join-twice join-killed join-bad-pid \
+       multi-recurse multi-oom multi-child-fd
+args_argc_SRC = args-argc.c
+args_argv0_SRC = args-argv0.c
+args_argvn_SRC = args-argvn.c
+args_single_SRC = args-single.c
+args_multiple_SRC = args-multiple.c
+args_dbl_space_SRC = args-dbl-space.c
+sc_bad_sp_SRC = sc-bad-sp.c
+sc_bad_arg_SRC = sc-bad-arg.c
+sc_boundary_SRC = sc-boundary.c
+halt_SRC = halt.c
+exit_SRC = exit.c
+create_normal_SRC = create-normal.c
+create_empty_SRC = create-empty.c
+create_null_SRC = create-null.c
+create_bad_ptr_SRC = create-bad-ptr.c
+create_long_SRC = create-long.c
+create_exists_SRC = create-exists.c
+create_bound_SRC = create-bound.c
+open_normal_SRC = open-normal.c
+open_missing_SRC = open-missing.c
+open_boundary_SRC = open-boundary.c
+open_empty_SRC = open-empty.c
+open_null_SRC = open-null.c
+open_bad_ptr_SRC = open-bad-ptr.c
+open_twice_SRC = open-twice.c
+close_normal_SRC = close-normal.c
+close_twice_SRC = close-twice.c
+close_stdin_SRC = close-stdin.c
+close_stdout_SRC = close-stdout.c
+close_bad_fd_SRC = close-bad-fd.c
+read_normal_SRC = read-normal.c
+read_bad_ptr_SRC = read-bad-ptr.c
+read_boundary_SRC = read-boundary.c
+read_zero_SRC = read-zero.c
+read_stdout_SRC = read-stdout.c
+read_bad_fd_SRC = read-bad-fd.c
+write_normal_SRC = write-normal.c
+write_bad_ptr_SRC = write-bad-ptr.c
+write_boundary_SRC = write-boundary.c
+write_zero_SRC = write-zero.c
+write_stdin_SRC = write-stdin.c
+write_bad_fd_SRC = write-bad-fd.c
+exec_once_SRC = exec-once.c
+exec_arg_SRC = exec-arg.c
+exec_multiple_SRC = exec-multiple.c
+exec_missing_SRC = exec-missing.c
+exec_bad_ptr_SRC = exec-bad-ptr.c
+join_simple_SRC = join-simple.c
+join_twice_SRC = join-twice.c
+join_killed_SRC = join-killed.c
+join_bad_pid_SRC = join-bad-pid.c
+multi_recurse_SRC = multi-recurse.c
+multi_oom_SRC = multi-oom.c
+multi_child_fd_SRC = multi-child-fd.c
 
-SINGLETONS = \
-       $(addprefix create-, normal empty null bad-ptr long exists bound) \
-       $(addprefix args-, argc argv0 argvn single multiple dbl-space)
+SRCDIR = ../../src
 
-define SINGLETON_PROG
-PROGS += $(1)
-$(1)_SRC = $(1).c
-endef
+PROGS = $(TESTS) child-simple child-arg child-bad child-close
+child_simple_SRC = child-simple.c
+child_arg_SRC = child-arg.c
+child_bad_SRC = child-bad.c
+child_close_SRC = child-close.c
 
-$(foreach prog,$(SINGLETONS),$(eval $(call SINGLETON_PROG,$(prog))))
-DISKS = $(patsubst %,%.dsk,$(PROGS))
+DISKS = $(patsubst %,%.dsk,$(TESTS))
 
 disks: $(DISKS)
 
-PINTOS = ../../src/utils/pintos
-OS_DISK = ../../src/userprog/build/os.dsk
+exec-once.dsk exec-multiple.dsk join-simple.dsk join-twice.dsk: child-simple
+exec-arg.dsk: child-arg
+join-killed.dsk: child-bad
+multi-child-fd.dsk: child-close
+
 %.dsk: %
-       rm -f $@.tmp
-       $(PINTOS) make-disk $@.tmp 2
-       $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp run -f -q
-       $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp put $<
-       mv $@.tmp $@
+       ./prep-disk $<
 
 clean::
        rm -f $(DISKS)
 
 include $(SRCDIR)/Makefile.userprog
 
+# Use -Werror because otherwise there's so much output spew
+# that it's very difficult to pick out warnings.
 CFLAGS += -Werror
+
+Makefile: Make.base Make.tests mkmf
+       ./mkmf
+