Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: Getting dependencies from cl6x?

$
0
0

Hi, 

I found what i was looking for to accomplish out of tree builds with a makefile that can generate the dependencies
with the C6000 toolchain. 

I have come up with something that generates a *.pp file with out of tree and subdir information
You need to supply a --obj_directory and --output_file= option to have the correct behaviour.

I did not accomplish excluding the system headers but this is no requirement but a nice to have. 

MY EXAMPLE MAKEFILE SNIPPET 

$(O) --> contains the <outoftreefolder>
$(1) --> contains any subdirectory of the source code ( example board/board1.cpp )
$(Q) --> makefile variable to include or exclude the @ to silence the compiler call on the commandline
$(silent) --> contains > /dev/null to silence the echo command

MAKEFILE RECIPE

$(O)/$(1)%.o $(O)/$(1)%.pp: $(1)%.cpp
    @echo " [CXX] ($(O)) $$<" $(silent)
    $(Q)$$(CXX) $$(CXXFLAGS) --preproc_with_compile --preproc_dependency \
    --pp_directory=$(O)/$(1) --obj_directory=$(O)/$(1)--output_file=$$(@:.pp=.o) $$<

OUTPUT IN OUT OF TREE FOLDER

The *.pp file now contains the following (example with out of tree folder)
the out of tree folder in this case is: dsp-c6740-release and all *.pp and *.o
files are stored there for compilation. 

dsp-c6740-release/Acquisition.o: Acquisition.cpp
dsp-c6740-release/Acquisition.o: include/Acquisition.h
dsp-c6740-release/Acquisition.o: include/RegisterInterface.h
dsp-c6740-release/Acquisition.o: include/Controller.h
dsp-c6740-release/Acquisition.o: include/Io.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/stdint.h
dsp-c6740-release/Acquisition.o: include/Notification.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/cstring
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/yvals.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/stdarg.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/linkage.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/_lock.h
dsp-c6740-release/Acquisition.o: /data/tools/C6000CGT-7.4.2/include/string.h

I also have a out of tree folder dsp-c6740-release to build the release variant of the code

Hope this helps someone that is looking to do out of tree builds with the C6000 or C2000 toolchains
of TI

Regards Rob 


 


Viewing all articles
Browse latest Browse all 91752

Trending Articles