X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2FMakefile.userprog;h=0df391a24ed164db4fc6febe3d44c33443a30769;hp=870aae4b95f56bae532e8ab075c2e503d4ce4b71;hb=59f738d500f51ffc5f487344865b8bed69c26281;hpb=22acef028a140604f5b34705263ba70959fcf4f4 diff --git a/src/Makefile.userprog b/src/Makefile.userprog index 870aae4..0df391a 100644 --- a/src/Makefile.userprog +++ b/src/Makefile.userprog @@ -3,12 +3,8 @@ $(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): LDFLAGS += -nostdlib -static -Wl,-T,$(LDSCRIPT) +$(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/user.lds # Library code shared between kernel and user programs. lib_SRC = lib/debug.c # Debug code. @@ -16,6 +12,8 @@ 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 # 64-bit arithmetic for GCC. +lib_SRC += lib/ustar.c # Unix standard tar format utilities. # User level only library code. lib/user_SRC = lib/user/debug.c # Debug helpers. @@ -35,7 +33,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))))