VERSION := 3
SUBVERSION := 0
MINORVERSION := 1
+TARVERSION := 3.0.1
LIBVERSION := 3.0.1
############ vars
$(man1)snice.1 $(man1)pgrep.1 $(man1)pkill.1 \
$(man5)sysctl.conf.5 $(man8)vmstat.8 $(man8)sysctl.8
+TARFILES := AUTHORS BUGS NEWS README TODO COPYING COPYING.LIB ChangeLog \
+ Makefile Makefile.noam procps.lsm procps.spec v t \
+ minimal.c $(notdir $(SCRFILES)) $(notdir $(MANFILES)) \
+ uptime.c tload.c free.c w.c top.c vmstat.c watch.c skill.c \
+ sysctl.c pgrep.c top.h
+
CURSES := -I/usr/include/ncurses -lncurses
LDFLAGS := -Wl,-warn-common
.SUFFIXES:
.SUFFIXES: .a .o .c .s .h
-.PHONY: all clean do_all install # ps
+.PHONY: all clean do_all install tar # ps
ALL := $(notdir $(BINFILES))
#%.d: %.c
# depend.sh $(CFLAGS) $< > $@
+# don't want to type "make procps-$(TARVERSION).tar.gz"
+tar: $(TARFILES)
+ mkdir procps-$(TARVERSION)
+ (tar cf - $(TARFILES)) | (cd procps-$(TARVERSION) && tar xf -)
+ tar cf procps-$(TARVERSION).tar procps-$(TARVERSION)
+ gzip -9 procps-$(TARVERSION).tar
+
clean:
rm -f $(CLEAN)
###### install
$(BINFILES) : $(@F)
- $(install) --mode a=rx --strip $< $@
+ $(install) --mode a=rx --strip $(notdir $@) $@
$(SCRFILES) : $(@F)
- $(install) --mode a=rx $< $@
+ $(install) --mode a=rx $(notdir $@) $@
$(MANFILES) : $(@F)
- $(install) --mode a=r $< $@
+ $(install) --mode a=r $(notdir $@) $@
install: $(INSTALL)
cd $(usr/bin) && ($(ln-f) skill snice; $(ln-f) skill kill; $(ln-f) pgrep pkill)
#include <string.h> /* for strcmp */
#include <stdio.h> /* for parse error output */
-#include "proc/readproc.h" /* for proc_t */
+#include "readproc.h" /* for proc_t */
-#include "proc/compare.h" /* for this code */
+#include "compare.h" /* for this code */
/*
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/utsname.h>
-#include "proc/procps.h"
-#include "proc/version.h"
-#include "proc/sysinfo.h" /* smp_num_cpus */
+#include "procps.h"
+#include "version.h"
+#include "sysinfo.h" /* smp_num_cpus */
#define KSYMS_FILENAME "/proc/ksyms"
LIBHDR := $(wildcard proc/*.h)
LIBOBJ := $(LIBSRC:.c=.o)
+
+LIB_X := COPYING Makefile.noam module.mk
+TARFILES += $(LIBSRC) $(LIBHDR) $(addprefix proc/,$(LIB_X))
+
+
# Clean away all output files, .depend, and symlinks.
# Use wildcards in case the version has changed.
CLEAN += proc/.depend proc/lib*.so* proc/lib*.a $(LIBOBJ)
$(strip $(CC) $(LIB_CFLAGS) -MM -MG $(LIBSRC) > $@)
ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),tar)
-include proc/.depend
endif
+endif
$(lib)/$(SONAME) : proc/$(SONAME)
#include <sys/types.h>
#include <stdlib.h>
#include <pwd.h>
-#include "proc/procps.h"
+#include "procps.h"
#include <grp.h>
#define HASHSIZE 16 /* power of 2 */
\***********************************************************************/
-#include "proc/procps.h"
-#include "proc/readproc.h"
+#include "procps.h"
+#include "readproc.h"
#include "status.h"
char * status(proc_t* task) {
#include <time.h>
#include <utmp.h>
#include <sys/ioctl.h>
-#include "proc/whattime.h"
-#include "proc/sysinfo.h"
+#include "whattime.h"
+#include "sysinfo.h"
static char buf[128];
static double av[3];
# a file to create
ALL += ps/ps
-PSNAMES := $(addprefix ps/,display escape global help output parser select sortformat)
+PS_C := display escape global help output parser select sortformat
+PSNAMES := $(addprefix ps/,$(PS_C))
PSOBJ := $(addsuffix .o,$(PSNAMES))
PSSRC := $(addsuffix .c,$(PSNAMES))
+PS_X := COPYING HACKING TRANSLATION Makefile.noam common.h module.mk it p ps.1 regression
+TARFILES += $(PSSRC) $(addprefix ps/,$(PS_X))
+
ps/ps: $(PSOBJ) $(LIBPROC)
$(CC) $(LDFLAGS) -o $@ $^
ps/debug: $(PSOBJ) stacktrace.o $(LIBPROC)
$(CC) -o $@ $^ -lefence
-$(PSOBJ): %.o: ps/%.c ps/common.h proc/$(SONAME)
+$(PSOBJ): %.o: %.c ps/common.h proc/$(SONAME)
$(CC) -c $(CFLAGS) $< -o $@
ps/stacktrace.o: ps/stacktrace.c
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
-#include <proc/sig.h>
-#include <proc/devname.h>
-#include <proc/procps.h> /* char *user_from_uid(uid_t uid) */
+#include "proc/sig.h"
+#include "proc/devname.h"
+#include "proc/procps.h" /* char *user_from_uid(uid_t uid) */
#include "proc/version.h" /* procps_version */
static int f_flag, i_flag, v_flag, w_flag, n_flag;