Skip to content

Commit 17121a4

Browse files
committed
Corrections
1. Regular expression in egrep. Which would cause missing lots of source file 2. Correct sed separator in case of the string contain '/' 3. Don't print when missing file is libc header file Change-Id: I4e1437c23667d9473f966c888d2ce68ab563ba99
1 parent 0f089d6 commit 17121a4

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

PF_Prj_Gen.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ if [ "${SOURCE_CODE_TYPE}" = "KERNEL" ]; then
131131

132132
# the source file used to be compiled (.S .s .c)
133133
KERNEL_VALID_SRC_FILES=
134-
KERNEL_VALID_SRC_FILES=`find "${DIR_TO_BE_COUNT}" -name '.*.o.cmd' -print0 | xargs -0 egrep ' := [alnum]' \
134+
KERNEL_VALID_SRC_FILES=`find "${DIR_TO_BE_COUNT}" ! -path \*/.built-in.o.cmd -name '.*.o.cmd' -print0 | xargs -0 egrep ":=[[:space:]]+[[:alnum:]]+" \
135135
| grep -v '\-gcc' | grep -v '\-ld' | grep -v ' := gcc' | grep -v ' := g++' \
136136
| awk -F':=' '{print $2}' | grep -v 'scripts'`
137137

@@ -296,7 +296,10 @@ if [ "${SOURCE_CODE_TYPE}" = "KERNEL" ]; then
296296
if [ -n "${SearchMissFile}" ] ; then
297297
echo "${SearchMissFile}" >> valid_filelist.txt
298298
else
299-
echo "Not found file: ${files}"
299+
## exclude the libc header files
300+
if [ "stdarg.h" != "${NotFoundFileName}" ] ; then
301+
echo "Not found file: ${files}"
302+
fi
300303
fi
301304
fi
302305
done
@@ -331,9 +334,10 @@ if [ "${SOURCE_CODE_TYPE}" = "UBOOT" ]; then
331334
fi
332335
echo "${files}" >> "${VALID_SRC}"
333336
((Index++))
334-
echo -e -n "\rSource file[.c .S .s] copied number: "
337+
echo -e -n "\rSource file[.c .S .s] Index: "
335338
echo -e -n "\t[${Echo_Cyan_Text}${Index}${Echo_Color_Reset}]"
336339
done
340+
echo
337341

338342
## the depend is seperate to 2 line in .depend.XXX, eg:
339343
# a.o: \
@@ -410,7 +414,7 @@ if [ "${SOURCE_CODE_TYPE}" = "UBOOT" ]; then
410414
#echo files is ${files}
411415
cd "${DIR_TO_BE_COUNT}" && \
412416
PATH_OF_NOPATH_FILE=`find -name .depend.* | xargs grep -w ${files} -nIR | \
413-
sed "s/\.depend.*${files}/${files}/" | \
417+
sed "s@\.depend.*${files}@${files}@" | \
414418
tr -d '\\' 2>/dev/null` \
415419
&& cd - > /dev/null
416420

@@ -427,7 +431,7 @@ if [ "${SOURCE_CODE_TYPE}" = "UBOOT" ]; then
427431
fi
428432
echo "${files}" >> "${Valid_HF}"
429433
((Index++))
430-
echo -e -n "\rHeader file[.h] copied number: "
434+
echo -e -n "\rHeader file[.h] Index: "
431435
echo -e -n "[${Echo_Cyan_Text}${Index}${Echo_Color_Reset}]"
432436
done
433437
#echo -e "${Echo_Green_Text}...Done${Echo_Color_Reset}"

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
##Purpose
2-
The linux kernel and u-boot contains lots of files, when we want to broswe the source code,we just want to see these compiled files, and the header files which required.
3-
So this script in this repo is to make a filelist to tell us the files compiled and the header files depended.
2+
The linux kernel and u-boot contains lots of files, when we want to broswe the source code, we just want to see the compiled files, and the header files which required.
3+
This script will make a filelist to tell us the source files compiled and the header files required.
44

5-
Also, the script would genenate a filelist for the source code broswer IDE/Editor(source insight, Scitools Understand and SlickEdit)
5+
Also, the script would genenate a filelist for the source code broswer IDE/Editor(for now, support Source Insight, Scitools Understand and SlickEdit)
66

7-
If you use the source insight or Scitools Understand, or SlickEdit to broswe the linux kernel or/and U-boot source code, this script would help you to add the compiled source code(.S,.C) when you create Project.
7+
If you use the source insight or Scitools Understand, or SlickEdit to broswe the linux kernel or/and U-boot source code, this script would help you to add the compiled source code(.S,.C) when you improt needed source code and header files when create Project.
88

99
##Usage
10-
####Video
11-
You may want to see the video `PF_Prj_Gen_example.mkv` in directory usge of repo.
12-
In the video, I show the generation and the usage of the Generation file/project for Understand and SlickEdit.
13-
14-
Also a video(SourceInsight_Example.mkv in usage directory of this repo) shows the generation of filelist for the Source Insight.
15-
16-
####GIF show
17-
######How to generate
10+
####Demo shows in GIF
11+
######GIF Shows How to generate
1812
Below is a GIF, shows how to generate the filelist and slickedit workspace/project, the parameters of command:
1913

2014
- Parameter1, directory of compiled source code, here is kernel: ~/github/BBB/Sebastian-BBB-Hibernation-2
@@ -33,20 +27,23 @@ Below Gif shows the procedure of generation and import
3327
![intro](https://raw.githubusercontent.com/tonyho/Generate_Kernel_Uboot_Project_forIDE/master/usage/Understand_show.gif?raw=true "Slickedit demo")
3428

3529
###Text word illustration
36-
####0. compile
30+
####0. Compile
3731
compile the kernel or u-boot source code
38-
####1. clone
32+
####1. Clone
3933

4034
git clone https://github.com/tonyho/Generate_Kernel_Uboot_Project_forIDE.git
41-
4235
####2. Generate
4336

4437
cd Generate_kernel_uboot_project_forIDE
4538
./PF_Prj_Gen.sh Path_For_Compiled_Kernel(Uboot)_Directory OutPutProjectFileName
4639

47-
This would create the filelist for Understand and Source Insight and the Slickedit Project in Outputprojectfilename.And you can use these output file to genenate the project.
40+
This would create the filelist for Understand and Source Insight and the Slickedit Project in Outputprojectfilename. THen you can use these output file to genenate the project.
41+
####Demo shows in Video
42+
You may want to see the video `PF_Prj_Gen_example.mkv` in directory usge of repo.
43+
In the video, I show the generation and the usage of the Generation file/project for Understand and SlickEdit.
44+
45+
Also a video(`SourceInsight_Example.mkv` in usage directory) shows the generation of filelist for the Source Insight.
4846

4947
##ToDo
50-
- Add Eclipse support
5148
- Add Source Navigator Support
52-
- Add the dts for kernel/uboot filelist
49+
- Add the dts/dtsi to filelist for kernel/uboot

0 commit comments

Comments
 (0)