This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
procps.mk
77 lines (60 loc) · 2.17 KB
/
procps.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# procps for the Blackfin
# David Rowe March 2008
#
# Useful utils like slabtop, a complete top etc.
#
# usage: make -f procps.mk procps-package
include rules.mk
PROCPS_MAJOR=3
PROCPS_SUBVERSION=2
PROCPS_MINOR=7
PROCPS_VERSION=$(PROCPS_MAJOR).$(PROCPS_SUBVERSION).$(PROCPS_MINOR)
PROCPS_DIRNAME=procps-$(PROCPS_VERSION)
PROCPS_DIR=$(BUILD_DIR)/$(PROCPS_DIRNAME)
PROCPS_SITE=http://procps.sourceforge.net/
PROCPS_SOURCE=procps-$(PROCPS_VERSION).tar.gz
PROCPS_UNZIP=zcat
CFLAGS = -I$(STAGING_DIR)/usr/include -I. -D_GNU_SOURCE \
-DVERSION=\"$(PROCPS_MAJOR)\" \
-DSUBVERSION=\"$(PROCPS_SUBVERSION)\"
LDFLAGS = -L$(STAGING_DIR)/usr/lib -lncurses
TARGET_DIR=$(BUILD_DIR)/tmp/procps/ipkg/procps
PKG_NAME:=procps
PKG_VERSION:=$(PROCPS_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/procps
$(DL_DIR)/$(PROCPS_SOURCE):
$(WGET) -P $(DL_DIR) $(PROCPS_SITE)/$(PROCPS_SOURCE)
$(PROCPS_DIR)/.unpacked: $(DL_DIR)/$(PROCPS_SOURCE)
$(PROCPS_UNZIP) $(DL_DIR)/$(PROCPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $(PROCPS_DIR)/.unpacked
procps: $(PROCPS_DIR)/.unpacked
cd $(PROCPS_DIR); \
bfin-linux-uclibc-gcc $(CFLAGS) $(LDFLAGS) \
slabtop.c proc/slab.c proc/version.c -o slabtop; \
bfin-linux-uclibc-gcc $(CFLAGS) $(LDFLAGS) \
top.c proc/devname.c proc/readproc.c \
proc/sig.c proc/sysinfo.c proc/version.c \
proc/whattime.c proc/pwcache.c proc/alloc.c \
proc/ksym.c proc/escape.c -o top
mkdir -p $(TARGET_DIR)/bin
cd $(PROCPS_DIR); cp -f slabtop top $(TARGET_DIR)/bin
$(STRIP) $(TARGET_DIR)/bin/slabtop
mkdir -p $(TARGET_DIR)/usr/doc
cp doc/procps.txt $(TARGET_DIR)/usr/doc
touch $(PKG_BUILD_DIR)/.built
all: procps
define Package/$(PKG_NAME)
SECTION:=lang
CATEGORY:=Languages
TITLE:=proc utils like slabtop, top...
DESCRIPTION:=\
procps is the package that has a bunch of small useful \\\
utilities that give information about processes using the \\\
/proc filesystem. The package includes the programs ps, top, \\\
vmstat, w, kill, free, slabtop, and skill.
URL:=http://procps.sourceforge.net
endef
# post installation
$(eval $(call BuildPackage,$(PKG_NAME)))
procps-package: procps $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk