X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2FMakefile.userprog;h=f90b08c965e365022aa78b0d97eb417c0160c6b4;hp=447088e8e7896212d8b5ce91879a0854b43f4cd4;hb=4ae5b30e5eb0be98521235060001c2d6d9828345;hpb=f415a37905c57f61b444806bf84f5405184452aa diff --git a/src/Makefile.userprog b/src/Makefile.userprog index 447088e..f90b08c 100644 --- a/src/Makefile.userprog +++ b/src/Makefile.userprog @@ -3,8 +3,7 @@ $(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): LDFLAGS += -nostdlib -static -Wl,-T,$(LDSCRIPT) $(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/user.lds # Library code shared between kernel and user programs. @@ -13,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. @@ -32,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))))