Output of used_files.py without arguments
This program creates a list of the source files (such as C headers) used to build the project for Eclipse CDT plugin. It only needs to be run for the new projects, the existing ones already have .cproject file distributed in each subproject repository (in 'eclipse_project_setup' sub- directory of the root sub-project directory). This sub-directory content is copyied to the sub- project root by setup.py when it is first run. You may delete .project file (while Eclipse is closed) and re-run setup.py (in elphel393 directory) restore default project settings if they get corrupted.
The program does not rely on exact duplicating of the environment used by bitbake, instead it "spies" on the bitbake by noticing which files it accesses during build (using file modification and access timestamps) and creates list of exclusions. As the access time is recorded only after the first access after modification, the program first unpacks/touches the sources.
The extra_source directory is the specified in the command line directory (in addition to hard-coded 'src') with sub-tree of the source files (headers) to be filtered.
Here is the full sequence (target is the project name extracted from .cproject): 1. bitbake target -c cleansstate 2. bitbake target -c unpack -f 3. bitbake target -c configure -f 4. Scan all files under extra_source directory, find last modification stamp 5. bitbake target -c compile -f 6. bitbake target -c install -f # in the case of Linux kernel in triggers compilation of the kernel modules 7. Scan source files, create list of the used files and then list of excluded files (Eclipse CDT allows to specify directory and exclusion filter) 8. Add (or replace) the record in .cproject file that specifies source directory and the filter
You need to run indexing (right-click on the project in the Navigator panel -> Index -> rebuild when the workspace is opened with the modified .cproject file.
Do not run this program when Eclipse IDE is opened that includes the current project!
The program should be launched from the project root directory, e.g. for applications: ./scripts/used_files.py sysroots
Program can either overwrite the current .cproject configuration file or create a new modified version if specified in teh command line argument. In that case program runs in debug mode and generates lists of files in the project root directory:== Output of used_files.py withou arguments ==
all_sources.lst - all scanned source file with last access timestamps including.lst - list of the files (relative to specified extra_source directory) used by bitbake excluding.lst - list of the unused files (they will appear crossed in the Project Navigator)
USAGE: ./used_files.py extra_source [path-to-modified-cproject]
First (mandatory) argument of this program (extra_source) is the relative path additional source/header files. For Linux kernel development it is 'linux', for php extension - 'php, for applications - 'sysroots' (symlink to header files)
Second (optional) argument (path-to-modified-cproject) is the relative to project root file to write modified .cproject content. If specified it forces program to run in debug mode and generate 3 file lists.