* build/Makefile (DISTFILES): Add gensources.sh.
* build/gensources.sh: New, improved version of tools/gensources.sh.
* build/library.make ($(sourcefile)): Use the new gensources.sh.
($(makefrag)): Update to handle the optional makefrag generated by
gensources.sh.
* tools/Makefile (DISTFILES): Remove gensources.sh.
* tools/gensources.sh: Remove.
svn path=/trunk/mcs/; revision=154909
+2010-04-07 Raja R Harinath <harinath@hurrynot.org>
+
+ * Makefile (DISTFILES): Add gensources.sh.
+ * gensources.sh: New, improved version of tools/gensources.sh.
+ * library.make ($(sourcefile)): Use the new gensources.sh.
+ ($(makefrag)): Update to handle the optional makefrag generated by
+ gensources.sh.
+
2010-04-01 Zoltan Varga <vargaz@gmail.com>
* config-default.make (LIBRARY_FLAGS): Applied patch from Laurent Etiemble
corcompare.make \
corcompare-api.xsl \
executable.make \
+ gensources.sh \
library.make \
nunit-summary.xsl \
rules.make \
--- /dev/null
+#! /bin/sh
+
+outfile=$1
+incfile=$2
+excfile=$3
+
+process_includes_1() {
+ sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' $1 > $2
+ if cmp -s $1 $2; then
+ false
+ else
+ sed -n 's,^[ \t]*#include ,,p' $1 |
+ while read inc; do
+ cat $inc >> $2
+ echo $outfile: $inc >> $outfile.makefrag
+ echo $inc: >> $outfile.makefrag
+ done
+ fi
+}
+
+process_includes() {
+ i=$1; o=$2; t=${2}.tmp
+ while process_includes_1 $i $o; do
+ mv $o $t
+ i=$t
+ done
+ rm -f $t
+}
+
+rm -f $outfile.makefrag
+
+process_includes $incfile $outfile.inc
+
+sort -u $outfile.inc > $outfile.inc_s
+
+if test -z "$excfile"; then
+ mv $outfile.inc_s $outfile
+else
+ process_includes $excfile $outfile.exc
+
+ sort -u $outfile.exc > $outfile.exc_s
+
+ sort -m $outfile.inc_s $outfile.exc_s | uniq -u > $outfile
+
+ rm -f $outfile.inc_s $outfile.exc_s
+fi
+
+
PROFILE_excludes = $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources)
COMMON_sourcefile := $(sourcefile)
sourcefile = $(depsdir)/$(PROFILE)_$(LIBRARY).sources
-$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(COMMON_sourcefile)
+
+# Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
+# We don't include it in the dependencies since it isn't always created
+$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(COMMON_sourcefile) $(topdir)/build/gensources.sh
@echo Creating the per profile list $@ ...
- $(topdir)/tools/gensources.sh $(PROFILE_sources) $(PROFILE_excludes) > $@
+ $(SHELL) $(topdir)/build/gensources.sh $@ $(PROFILE_sources) $(PROFILE_excludes)
library_CLEAN_FILES += $(sourcefile)
endif
$(makefrag): $(sourcefile)
@echo Creating $@ ...
@sed 's,^,$(build_lib): ,' $< >$@
+ @if test ! -f $(sourcefile).makefrag; then :; else \
+ cat $(sourcefile).makefrag >> $@ ; \
+ echo '$@: $(sourcefile).makefrag' >> $@; \
+ echo '$(sourcefile).makefrag:' >> $@; fi
ifneq ($(response),$(sourcefile))
$(response): $(sourcefile) $(PLATFORM_excludes)
+2010-04-07 Raja R Harinath <harinath@hurrynot.org>
+
+ * Makefile (DISTFILES): Remove gensources.sh.
+ * gensources.sh: Remove.
+
2010-04-03 Ankit Jain <jankit@novell.com>
* Makefile: Move xbuild from net_4_0_dirs to per_profile_dirs.
scan-tests.pl \
tinderbox/smtp.c \
tinderbox/tinderbox.sh \
- gensources.sh \
removecomments.sh
test-local csproj-local run-test-local run-test-ondotnet-local all-local install-local uninstall-local doc-update-local:
+++ /dev/null
-#!/usr/bin/env bash
-
-includefile=$1
-excludefile=$2
-
-## input variables:
-## $filelist:
-## A colon (':') separated list of files already read.
-## Must be initialized to ":".
-## $excludelist:
-## A newline separated of element (support Shell Patterns) to exclude.
-## $separator:
-## The separator used in list for the output
-##
-## output variables:
-## $list:
-## A list of elements separated by the separator given in $separator.
-## The new elements will be appended to the list.
-readlist () {
- local onelist
- local onelistcontent
- onelist=$1
-
- if [ ":$onelist:" = "::" ] ; then return ; fi
- if [ ! -f $onelist ] ; then return ; fi
- if [ ":${filelist##*:$onelist:*}:" = "::" ] ; then return ; fi
- filelist=":$onelist$filelist"
-
- onelistcontent=`cat $onelist | sed "s=[ \t]*$==g" | while read line ; do echo -n $line ; echo -n ":" ; done`
-
- OFS="$IFS"
- IFS=":"
- for line in $onelistcontent ; do
- line2=${line##\#}
- if [ ":$line:" = ":$line2:" ] ; then
- for linex in $excludelist ; do
- if [ ":${line##$linex}:" = "::" ] ; then line="" ; fi
- done
- if [ ":$line:" != "::" ] ; then
- if [ ":$list:" = "::" ] ; then
- list="$line"
- else
- list="$list$separator$line"
- fi
- fi
- else
- line3=${line2##include }
- if [ ":$line3:" != ":$line2:" -a ":$line3:" != "::" ] ; then
- readlist "$line3"
- fi
- fi
- done
- IFS="$OFS"
-}
-
-list=""
-filelist=":"
-excludelist=""
-separator=":"
-readlist "$excludefile"
-
-excludelist="$list"
-list=""
-filelist=":"
-separator="
-"
-readlist "$includefile"
-echo "$list" | sort | uniq