I've managed to create a working Makefile for a package I wish to install:
#
# Copyright (C) 2007-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package:
$(PKG_BUILD_DIR)
PKG_NAME:=libax25
PKG_VERSION:=0.0.12-rc4
PKG_RELEASE:=1
PKG_MAINTAINER:=Ralf Baechle DL5RB <ralf@linux-mips.org>
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=/home/user/mypackages/examples/libax25
# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
PKG_SOURCE:=libax25-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.linux-ax25.org/pub/libax25
PKG_MD5SUM:=9b2e6890ef20dd0cf8ac7fdb22e6a4b6
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/libax25
SECTION:=examples
CATEGORY:=Examples
TITLE:=ax25 library for hamradio applications
URL:=http://www.linux-ax25.org/
MAINTAINER:=Ralf Baechle DL5RB <ralf@linux-mips.org>, \
Thomas Osterried DL9SAU <ax25@x-berg.in-berlin.de>
DEPENDS:=+kmod-ax25
endef
# Package description; a more verbose description on what our package does
define Package/libax25/description
This library is for ham radio applications that use the ax25
protocol. Included are routines to do ax25 address parsing, common
ax25 application config file parsing, etc.
endef
define Package/libax25/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libax25))
have setup SDK, path, feeds file, etc. and typed the commands:
cd /home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64
./scripts/feeds update mypackages
./scripts/feeds install -a -p mypackages
make package/libax25/compile
And my computer appears to be making a lot of IPK files...when I tested helloworld it only made one.
Is this because of the DEPENDS:=+kmod-ax25 argument?
If so...does this mean when I install this IPK on my router, that it will attempt to install kmod-ax25 first???
I have further edited the Makefile, allowed hundreds of IPKs to compile, and I am now here:
daemon.c: In function 'daemon_start':
daemon.c:43:12: warning: implicit declaration of function 'open' [-Wimplicit-function-declaration]
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
^
daemon.c:43:29: error: 'O_RDWR' undeclared (first use in this function)
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
^
daemon.c:43:29: note: each undeclared identifier is reported only once for each function it appears in
Makefile:461: recipe for target 'daemon.lo' failed
make[4]: *** [daemon.lo] Error 1
make[4]: Leaving directory '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/libax25-0.0.12-rc4'
Makefile:339: recipe for target 'all' failed
When compiling software, I recall I had to add the various arguments if errors appeared...but where in my Makefile do I specify to run with -Wimplicit-function-declaration ...and what is the proper syntax for the file (or provide a link to a tutorial on this specific topic)?
I may be wrong, and very well may be, but I don't believe a library should result in hundreds of additional packages being compiled (someone else will need to confirm if my understanding is correct, as I've never tried what you're doing).
If anyone could provide a links to more detailed information regarding how to do this...I've successfully compiled the dependency, I jus don't know how to tell the SDK or makefile how to locate them...
Should I move the foo.h files to the correct folder, ot is it looking for the libax25 binaries?
I assume it's looking for the binaries (and not the header files from the other TAR). If so...does it want the x86_64 or mips_24kc binaries?
It might bee good idea to have make files
to all libax25 hamlib aprsx combined,..?
Like I try to get A5-V11 to work as aprx + modem
also try if enough power/sapce left for rtl-sdr !!
I took many hours to find fixes,... copy netax25 directory to build_dirs,...
But it could be better procedure to build aprx libax25 + all tools from
sources and I can not find make file's which should be added
to cloned git sources ,... BUT NOW I KNOW HOW TO MAKE ONE !