Compiling a single package

hi, i would like create some packages without "reinventing the wheel" (aka i don't wanna build a complete firmware).
several package install attempts ended up with wrong architecture message so install was denied.
packages with mips_24kc in the package name succeeded.
i got already that openwrt using mips24kc on mips74kc cpu is a compatible thing.

the target device is a TP-Link Archer C7 v4.0 with recent snapshot installed on it.
cpuinfo:
system type: Qualcomm Atheros QCA956x ver 1 rev 0
cpu model: MIPS 74Kc V5.0
isa: mips1 mips2 mips32r1 mips32r2
ASEs implemented: mip16 dsp dsp2

so i ask how to compile (cross-compile) a source code (from GitHUb e.g.) for the given router to get a "myapp_mips_24kc.ipk" or mips_74kc.ipk

under what linux distro easy to make the building environment. and how to setup that environment.
if somebody can show me step-by-step style would be highly appreciated. (mostly c source code)

thanx guys

Some stuff related to your question:

https://openwrt.org/docs/guide-developer/build-system/start
https://openwrt.org/docs/guide-developer/packages
https://openwrt.org/docs/guide-developer/single.package
https://openwrt.org/docs/guide-developer/helloworld/start

Package architecture for Archer C7 v4 = mips_24kc

1 Like

thanx tmomas,
i have a full kali rolling 2018.2 on my host (the builder pc) debian
from quickstart i got:
sudo apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget zip time
i suppose those will be my build "tools"

next:
git clone https://git.openwrt.org/openwrt/openwrt.git/
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
i suppose these feeds necessary if my app has some dependecies to fetch

next:
make menuconfig
after selecting target platform
here i don't have a ready package to select, but i have tar.gz and tar.bz2 downloaded from some hub which say openwrt source (looks to me C language) and say depends on
Berkeley DB - http://www.sleepycat.com/
OpenSSL - http://www.openssl.org/
libpcap - http://www.tcpdump.org/
libnids - http://www.packetfactory.net/Projects/Libnids/
libnet - http://www.packetfactory.net/Projects/Libnet/

so it is still looks like mission impossible
on some ancient openwrt version they were built but not on new hardware.

meanwhile little progress in understanding of sdk. buttt, my mind can not embrace this makefile thing. the source has few folders, .c, .h etc. extension files and makefiles for gnu make command to work. should i throw all those makefiles out and construct an sdk compatible single makefile to take care of the complete building process?
(the referred progress above is that my intended app package already shows up in menuconfig selectable (defaulted M)) but then compile goes havoc.

$ make package/example/{clean,compile}

JEFFreal, thanx i've tried this already. looks to me the found (used) lede makefiles has no sections about build neither compiling. the tarball included makefiles looks like native linux make/ make install info. (on a standard linux i can install it locally). as i mentioned i did not get the whole idea how to construct lede makefile to compile a complex package not just a single helloworld.c source file. will it (should it) use those Makefiles from the tarball or what. when i extract tarball on a linux machine and make / make install those makefiles do everything for me and then ready to use the commands provided by those package.