package/devel/trace-cmd: Update to 2.6
[openwrt/staging/mkresin.git] / package / devel / trace-cmd / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=trace-cmd
4 PKG_VERSION:=v2.6
5 PKG_RELEASE=1
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
9 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10 PKG_SOURCE_VERSION:=9be5d74805830a291615f2f34a27c903f6a37b1e
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 # PKG_MIRROR_MD5SUM:=6a08dfa2519a969d184e7bb5bb390620
13 PKG_INSTALL:=1
14 PKG_USE_MIPS16:=0
15 PKG_LICENSE:=GPL-2.0
16
17 PKG_BUILD_PARALLEL:=1
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/trace-cmd
22 SECTION:=devel
23 CATEGORY:=Development
24 TITLE:=Linux trace command line utility
25 DEPENDS:=
26 endef
27
28 define Package/trace-cmd-extra
29 SECTION:=devel
30 CATEGORY:=Development
31 TITLE:=Extra plugins for trace-cmd
32 DEPENDS:=
33 endef
34
35 MAKE_FLAGS += \
36 NO_PYTHON=1 \
37 prefix=/usr
38
39 PLUGINS_DIR := $(PKG_INSTALL_DIR)/usr/lib/trace-cmd/plugins
40 PLUGINS_MAIN := function hrtimer mac80211 sched_switch
41
42 TARGET_CFLAGS += --std=gnu99 -D_GNU_SOURCE
43
44 define Package/trace-cmd/install
45 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/trace-cmd/plugins
46 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trace-cmd $(1)/usr/bin/
47 $(CP) \
48 $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \
49 $(1)/usr/lib/trace-cmd/plugins
50 endef
51
52 define Package/trace-cmd-extra/install
53 $(INSTALL_DIR) $(1)/usr/lib/trace-cmd/plugins
54 $(CP) \
55 $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \
56 $$(filter-out $(PLUGINS_MAIN), \
57 $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \
58 $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \
59 $(1)/usr/lib/trace-cmd/plugins
60 endef
61
62 $(eval $(call BuildPackage,trace-cmd))
63 $(eval $(call BuildPackage,trace-cmd-extra))