- target_file = second
-}
-
-END {
- if ( input_file ) {
- if ( ! target_file )
- target_file = third
- print input_file >>target_file
- }
-}
-
-EOF
-
- rm -f .projects.all
- for p in `echo $QMAKE_PROJECTS`; do
- echo "$p" >> .projects.all
- done
-
- # if you get errors about the length of the command line to awk, change the -l arg
- # to split below
- split -l 100 .projects.all .projects.all.
- for p in .projects.all.*; do
- "$AWK" -f projects.awk `cat $p`
- [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
- [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
- [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
- rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
- done
- rm -f .projects.all* projects.awk
-
- [ -f .projects.1 ] && cat .projects.1 >>.projects
- [ -f .projects.2 ] && cat .projects.2 >>.projects
- rm -f .projects.1 .projects.2
- if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
- cat .projects.3 >>.projects
- rm -f .projects.3
- fi
-fi
-# don't sort Qt and MOC in with the other project files
-# also work around a segfaulting uniq(1)
-if [ -f .sorted.projects.2 ]; then
- sort .sorted.projects.2 > .sorted.projects.2.new
- mv -f .sorted.projects.2.new .sorted.projects.2
- cat .sorted.projects.2 >> .sorted.projects.1
-fi
-[ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
-rm -f .sorted.projects.2 .sorted.projects.1
-
-NORM_PROJECTS=0
-FAST_PROJECTS=0
-if [ -f .projects ]; then
- uniq .projects >.tmp
- mv -f .tmp .projects
- NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
-fi
-if [ -f .projects.3 ]; then
- uniq .projects.3 >.tmp
- mv -f .tmp .projects.3
- FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
-fi
-echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
-echo
-
-PART_ROOTS=
-for part in $CFG_BUILD_PARTS; do
- case "$part" in
- tools) PART_ROOTS="$PART_ROOTS tools" ;;
- libs) PART_ROOTS="$PART_ROOTS src" ;;
- translations) PART_ROOTS="$PART_ROOTS translations" ;;
- examples) PART_ROOTS="$PART_ROOTS examples" ;;
- *) ;;
- esac
-done
-
-if [ "$CFG_DEV" = "yes" ]; then
- PART_ROOTS="$PART_ROOTS tests"
-fi
-
-echo "Creating makefiles. Please wait..."
-for file in .projects .projects.3; do
- [ '!' -f "$file" ] && continue
- for a in `cat $file`; do
- IN_ROOT=no
- for r in $PART_ROOTS; do
- if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
- IN_ROOT=yes
- break
- fi
- done
- [ "$IN_ROOT" = "no" ] && continue