Reputation: 1027
I'm looking to compile an Elixir package for OpenWRT, but am new to building Makefiles for OpenWRT.
I'm not sure where to start and plan to start by scaling down the erlang Makefile (https://github.com/openwrt/packages/blob/master/lang/erlang/Makefile) and start with erlang as it's only dependency.
I have looked for a guide on getting started with OpenWRT Makefiles, but have not found one.
Would anyone be willing to guide me through the process?
Upvotes: 3
Views: 803
Reputation: 939
First, read this manual: http://wiki.openwrt.org/doc/devel/packages
Basically, you will need to create <openwrt-dir>/package/elixir
directory and create a Makefile there like this:
include $(TOPDIR)/rules.mk
PKG_NAME:=elixir
PKG_REV:=0e3c06b03149022b980e69872003d401c4788fea
PKG_VERSION:=v1.1.0-rc.0
PKG_RELEASE=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/elixir-lang/elixir.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=lang
CATEGORY:=Languages
TITLE:=Elixir
DEPENDS+= +erlang
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/elixir $(1)/usr/bin
# copy other files that are needed on target
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
Then, issue make menuconfig
command and select your newly created package.
After that, compile by running make package/elixir/install V=s
and look if it compiles (it does on my machine).
Upvotes: 1