# Is it possible to have a minimal source tree?



## devtop (Sep 12, 2021)

I'm currently working on a embedded project, and i'm trying to understand if it's possible to have a small _/usr/src _tree.
This source tree only has to contain the FreeBSD bootloader, kernel, kernel-modules, because the embedded application will replace _/sbin/init_.

So is is possible to have a small source tree with only these components while still being makeable?


----------



## drhowarddrfine (Sep 13, 2021)

Why do you need the source for a running embedded application?


----------



## a6h (Sep 13, 2021)

The key is the make(1), i.e. "makefile"(s), their included files, and selected "target"(s).
That determines which parts of the src/ are needed.
There is no need to trim src/ while working with embedded/cross-building.


----------



## mark_j (Sep 17, 2021)

You could remove the other architectures in the tree, but what does it achieve?
As vigole wrote, it's all in the make.  Make is only going to touch code it needs to build stuff specified in your conf file.


----------



## zirias@ (Sep 17, 2021)

drhowarddrfine said:


> Why do you need the source for a running embedded application?


Or: Why does the source need to be small? Are you trying to build directly on your embedded platform? 

Otherwise, if it's just about not building stuff you don't need, have a look at src.conf(5) (and maybe make.conf(5)).


----------

