--- Makefile +++ Makefile 2010-10-04 16:53:11.028426820 +0000 @@ -107,7 +107,7 @@ CFLAGS = $(RPM_OPT_FLAGS) ALL_CFLAGS := $(PKG_CFLAGS) $(CFLAGS) $(LIBTYPE) PKG_LDFLAGS := -Wl,-warn-common -LDFLAGS := +LDFLAGS := -L ./proc -Wl,--as-needed -lproc ALL_LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS) ############ Add some extra flags if gcc allows @@ -250,7 +250,7 @@ pmap w uptime tload free sysctl vmstat u slabtop top: % : %.o $(LIBPROC) $(CC) $(ALL_CFLAGS) $^ $(ALL_LDFLAGS) -o $@ $(CURSES) -watch: % : %.o +watch: % : %.o $(LIBPROC) $(CC) $(ALL_CFLAGS) $^ $(ALL_LDFLAGS) -o $@ $(CURSES) ############ progX --> progY --- ps/module.mk +++ ps/module.mk 2010-10-04 16:46:47.668425720 +0000 @@ -20,11 +20,11 @@ PS_X := COPYING HACKING TRANSLATION comm TARFILES += $(PSSRC) $(addprefix ps/,$(PS_X)) ps/ps: $(PSOBJ) $(LIBPROC) - $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^ $(ldl) + $(CC) $(ALL_CFLAGS) $^ $(ALL_LDFLAGS) -o $@ $(ldl) # This just adds the stacktrace code ps/debug: $(PSOBJ) stacktrace.o $(LIBPROC) - $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^ -lefence $(ldl) + $(CC) $(ALL_CFLAGS) $^ $(ALL_LDFLAGS) -o $@ -lefence $(ldl) $(PSOBJ): %.o: %.c ps/common.h $(LIBPROC) $(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) $< -o $@