X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2FMakefile.userprog;h=3631cf1b221b2a3bf3e5e0fb02457338a39132db;hb=ccbd8543c5ad589e878a3924b2dd39d5a6a2f39d;hp=72e35ce7ee92a285e4d1b6562318247bda427754;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/Makefile.userprog b/src/Makefile.userprog index 72e35ce..3631cf1 100644 --- a/src/Makefile.userprog +++ b/src/Makefile.userprog @@ -1,16 +1,10 @@ # -*- makefile -*- -include $(SRCDIR)/Make.config - $(PROGS): CPPFLAGS += -I$(SRCDIR)/lib/user -I. # Linker flags. $(PROGS): LDFLAGS = -nostdlib -static -Wl,-T,$(LDSCRIPT) -$(PROGS): LDLIBS = $(shell $(CC) -print-libgcc-file-name) -$(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/normal.lds -# Uncomment the following line to round up section sizes -# to full pages (for debugging only). -#$(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/fullpage.lds +$(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/user.lds # Library code shared between kernel and user programs. lib_SRC = lib/debug.c # Debug code. @@ -18,6 +12,7 @@ lib_SRC += lib/random.c # Pseudo-random numbers. lib_SRC += lib/stdio.c # I/O library. lib_SRC += lib/stdlib.c # Utility functions. lib_SRC += lib/string.c # String functions. +lib_SRC += lib/arithmetic.c # User level only library code. lib/user_SRC = lib/user/debug.c # Debug helpers. @@ -37,7 +32,7 @@ all: $(PROGS) define TEMPLATE $(1)_OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$($(1)_SRC))) $(1): $$($(1)_OBJ) $$(LIB) $$(LDSCRIPT) - $$(CC) $$(LDFLAGS) $$($(1)_OBJ) $$(LIB) $$(LDLIBS) -o $$@ + $$(CC) $$(LDFLAGS) $$($(1)_OBJ) $$(LIB) -o $$@ endef $(foreach prog,$(PROGS),$(eval $(call TEMPLATE,$(prog))))