How to keep source code after compile?

Hi guys,

Im working at OpenWrt 23.05.4 branch and try to build a firmware for my TP-Link router. I try to add debug code to curl package and do clean/prepare, now still have source code.

[rpi4@b46fd08e8a20] openwrt$ make V=s package/feeds/packages/curl/{clean,prepare}
[rpi4@b46fd08e8a20] openwrt$ ls build_dir/target-aarch64_cortex-a72_musl/curl-8.7.1/
CHANGES           Makefile       acinclude.m4   config.guess    depcomp     libcurl.def    missing   src
CMake             Makefile.am    aclocal.m4     config.sub      docs        libcurl.pc.in  packages  tests
CMakeLists.txt    Makefile.in    buildconf      configure       include     ltmain.sh      plan9     winbuild
COPYING           README         buildconf.bat  configure.ac    install-sh  m4             projects
MacOSX-Framework  RELEASE-NOTES  compile        curl-config.in  lib         maketgz        scripts

Then, source code is gone after compile.

[rpi4@b46fd08e8a20] openwrt$ make V=s package/feeds/packages/curl/compile
[rpi4@b46fd08e8a20] openwrt$ ls build_dir/target-aarch64_cortex-a72_musl/curl-8.7.1/

My question is there a flag to disable remove source code feature? Thanks.

The source tarballs are in ‘./dl’ unless you remove them.

No, I mean the source code under building folder.

Usually, I will do clean/compile at OpenWrt 19.07, you can see the source code still under building folder. Then, I will go to building folder, change something and do compile again, the new binary will include my changes, that's what I want. Thanks.

Build_dir is meant to be only temporary.
make clean cleans sources from there.
You can try source modifications there, but once they work, you need to do the changes either to upstream packages via patches in packages directory, or modify the local files (scripts, config files) in the package/ or feeds/ dirs.

Try to remove CONFIG_AUTOREMOVE=y in .config

1 Like

@123serge123

This is what I want. Have a good time, thx.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.