Hi all, unfortunately, I am struggling with writing a Makefile. I want to build a modified version of htop for Raspberry Pi. Here is my makefile based on the original htop makefile:
#
# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=htop
PKG_VERSION:=d87d5c01230565b7dbe7259d76c0b6152eb69688
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/wbenny/htop/tar.gz/$(PKG_VERSION)?
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/htop-rpi
SECTION:=admin
CATEGORY:=Administration
TITLE:=Interactive processes viewer (Rasberry Pi Mod)
DEPENDS:=+libncurses
URL:=https://github.com/wbenny/htop.git
MAINTAINER:=alex
endef
define Package/htop-rpi/description
Htop is an ncursed-based process viewer similar to top, but
it allows to scroll the list vertically and horizontally to
see all processes and their full command lines. Raspberry Pi Mod.
endef
CONFIGURE_ARGS += \
--enable-linux-affinity \
--disable-unicode \
--disable-hwloc
CONFIGURE_VARS += \
ac_cv_file__proc_stat=yes \
ac_cv_file__proc_meminfo=yes
define Package/htop-rpi/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef
$(eval $(call BuildPackage,htop-rpi))
However, it does not work! What am I doing wrong?
alex@OpenWrt:~/openwrt$ make -j1 V=sc package/htop-rpi
time: target/linux/prereq#0.37#0.70#2.04
make[1]: Entering directory '/home/alex/openwrt'
cd "/home/alex/openwrt"; git log --format=%h -1 toolchain > /home/alex/openwrt/tmp/.ver_check
cmp -s /home/alex/openwrt/tmp/.ver_check /home/alex/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/stamp/.ver_check || { \
rm -rf /home/alex/openwrt/build_dir/target-aarch64_cortex-a72_musl /home/alex/openwrt/staging_dir/target-aarch64_cortex-a72_musl /home/alex/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl /home/alex/openwrt/build_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl; \
mkdir -p /home/alex/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/stamp; \
mv /home/alex/openwrt/tmp/.ver_check /home/alex/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/stamp/.ver_check; \
}
make[1]: *** No rule to make target 'package/htop-rpi'. Stop.
make[1]: Leaving directory '/home/alex/openwrt'
make: *** [/home/alex/openwrt/include/toplevel.mk:230: package/htop-rpi] Error 2