Skip to content

How sources are organized

negan07 edited this page Apr 8, 2019 · 17 revisions

git root dir

Makefile

Type make help to see the make help recipe usage.

Settings.mak

Includes the main flags, macro aliases, and dir variables.

DEBUG

debug mode: compile all packages and apps to be run on router ram (/tmp subdirs) with debug messages and temporary paths: used in addition with receive script.

LOCAL:

to compile tools and apps locally on host PC machine generally for safer/quicker debug way: generally used in addition with DEBUG flag.

BUILD:

to distinguish between .ipk packages creation and simple install: generally it is already invoked by main Makefile when needed.

diffs

Includes patch applied before compiling.

Organized into subdirs.

Patch files must have .diff extension.

Files must be named:

projectname_fwversion_dirname-patchordernum(3dgt)-patchcontent(title).diff .

Each patch file is assumed to be applied from git root with -p0 option.

Patch dirs:

apps - Built-in apps modifications: it contains subdirs.

crosstools - Toolchain modifications adaptations fixes.

kernel - Kernel source additions & adaptations.

misc - Source makefiles & environmental vars adaptations & modifications.

uclibc - Uclibc libs fixes, tunings, adaptations.

work - Work-thirdparty dir fixes, tunings, ...: it contains subdirs.

scripts

The scripts used.

Each script has its own built documentation inside.

apply_patch.sh - Apply source code diff patches before compiling.

dl_sources.sh - Download & extract source codes.

founddiff.sh - Found code differences between firmware versions.

git_info.sh - For commit versioning & changelog usage.

hostprepare.sh - Apt download & install necessary packets.

pack_fw.sh - Prepare firmware .zip pack after compiling.

opkg-utils-x.x.x - Dir containing packet building scripts & tools.

receive - Prepare debug environment on running router.

leds.sh - Led board treatment script & guideline.

renamediff.sh - Rename diffs from old firmware version to new one.

startup.sh - Initialize router for package installations.

tchainprepare.sh - Toolchain crosstools extract & patch modifications.

work

The workjob dir contaning the apps.

work/dirs.mak

Includes app vars information and apps subdirs var list: a sort of rudimental Config.in for make menuconfig . Here apps can be included or excluded from compiling. See the related document: include a new app to make work recipe for more informations.

work/env.mak

Includes dirs used on package installation, arch-dependent flag used on preprocessing compiling and linking.

work/Rules.mak

Dynamically created at runtime by makefile: don't edit directly.