Some external toolchaind don't automatically search for headers in $(STAGING_DIR), make sure we do pass TARGET_CPPFLAGS as appropriate. This fixes build errors such as: mipsel-linux-gnu-gcc -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c lua.c:80:31: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h> ^ compilation terminated. <builtin>: recipe for target 'lua.o' failed make[6]: *** [lua.o] Error 1 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>lilik-openwrt-22.03