-include Makefile.vars
-BUILD_SUBDIRS = $(addprefix build/, $(SUBDIRS))
-CP = cp
-MKDIR = mkdir
+# -*- makefile -*-
-all: build build/Makefile $(BUILD_SUBDIRS)
- $(MAKE) -C build
+all:
-$(BUILD_SUBDIRS):
- $(MKDIR) $@
-build:
- $(MKDIR) $@
+include Make.vars
+
+DIRS = $(sort $(addprefix build/,$(KERNEL_SUBDIRS) $(TEST_SUBDIRS) lib/user))
+
+all grade check: $(DIRS) build/Makefile
+ cd build && $(MAKE) $@
+$(DIRS):
+ mkdir -p $@
build/Makefile: ../Makefile.build
- $(CP) $< $@
+ cp $< $@
+
+build/%: $(DIRS) build/Makefile
+ cd build && $(MAKE) $*
clean:
rm -rf build