Are you talking about “building” su or copying it into the right location later on? Is it possible to build superuser as an application and just install it later? I remember reading something about it, but I guess you need its “su” and the application?
Can you write down in pseudo code what you want to do? Maybe someone can figure out where to modify the make files. A quick and dirty way would be to just add it to an existing one.
Build new su_phhusson
cp su_phhusson to system/xbin/su
And yes, make includes every Android.mk file it can find. If the are called differently, not. Or they must be included in the Android.mk before.
subdir_makefiles := \
$(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git $(subdirs) Android.mk)
Don’t forget to look into:
build/core/main.mk
build/core/Makefile
# For apps_only build we'll establish the dependency later in build/core/main.mk.
# build/core/Makefile contains extra stuff that we don't want to pollute this
# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES
# contains everything that's built during the current make, but it also further
# extends ALL_DEFAULT_INSTALLED_MODULES.