--enable-4meg-pages not needed after all
[pintos-anon] / src / tests / userprog / Makefile
index 9af275f5b27c3afb8e3da85c738ffb6b512b457c..eac2f2df156dc9e0c139bde3367324c251a09e13 100644 (file)
@@ -2,13 +2,18 @@ include ../../Make.config
 
 SHELL = /bin/sh
 
-LDFLAGS = -nostdlib -static -Wl,-T,elf.x
+LDFLAGS = -nostdlib -static
 LDLIBS = $(shell $(CC) -print-libgcc-file-name)
 
+# Uncomment the line below to round up segment sizes to full pages for
+# testing purposes only.
+#LDFLAGS += -Wl,-T,fullpage.x
+
 VPATH = ../..
 
 DEFINES = -DUSER
-CPPFLAGS = -nostdinc -I../.. -I- -I../../lib -I../../lib/user
+CPPFLAGS = -nostdinc -I../.. -I- -I../../lib -I../../lib/user \
+          -include constants.h
 
 # C library sources linked into every test program.
 LIB_SRC  = lib/debug.c                 # Debug code.
@@ -42,9 +47,12 @@ all: $(PROGS)
 
 define TEMPLATE
 $(1)_OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$($(1)_SRC)))
-$(1): $$($(1)_OBJ) $$(LIB)
+$(1): $$($(1)_OBJ) $$(LIB) | ./lib/user
 endef
 
+./lib/user:
+       $(MKDIR) -p lib/user
+
 $(foreach prog,$(PROGS),$(eval $(call TEMPLATE,$(prog))))
 
 $(PROGS): $(LIB)