makefile - How to undo intermediate file deletion -


i have software stack creates intermediate files part of build process. there problem come , build breaks. want have @ intermediate generated files. surprise files being deleted part of build process.

removing intermediate files... rm fact_test_without_proxies.c fact_test_main.c fact_test_without_proxies.o 

i went through makefiles don't see explicit rules deleting them. can there implicit rules delete intermediate files. if yes how can disable implicit rules ?

i see print removing intermediate files... if make executed --debug option.

skmt@tux:~/coding/factorial/ut$ make --debug gnu make 3.81 copyright (c) 2006  free software foundation, inc. free software; see source copying conditions. there no warranty; not merchantability or fitness particular purpose.  program built x86_64-pc-linux-gnu reading makefiles... updating goal targets....  file `check' not exist.    file `test_dept_run' not exist.      file `fact_test' not exist.        file `fact_using_proxies.o' not exist.            file `fact_test_without_proxies' not exist.             file `fact_test_without_proxies.o' not exist.              file `fact_test_without_proxies.c' not exist.               file `fact_test_main.c' not exist.              must remake target `fact_test_main.c'. nm -p fact_test.o | build_main_from_symbols >fact_test_main.c              remade target file `fact_test_main.c'.             must remake target `fact_test_without_proxies.c'. cp fact_test_main.c fact_test_without_proxies.c             remade target file `fact_test_without_proxies.c'.            must remake target `fact_test_without_proxies.o'. gcc  -i../src  -c -o fact_test_without_proxies.o fact_test_without_proxies.c            remade target file `fact_test_without_proxies.o'.           must remake target `fact_test_without_proxies'. gcc   fact_test_without_proxies.o fact.o fact_test.o   -o fact_test_without_proxies fact.o: in function `unknown': fact.c:(.text+0x67): undefined reference `do_update' collect2: ld returned 1 exit status make: *** [fact_test_without_proxies] error 1 removing intermediate files... rm fact_test_without_proxies.c fact_test_main.c fact_test_without_proxies.o 

if you're using gnumake, can use special target .precious:

.precious: fact_test_without_proxies.c fact_test_main.c fact_test_without_proxies.o 

or just

.precious: %.c %.o 

its effect these files not deleted if make killed or interrupted.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -