removecomments.sh 556 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # Remove comments from .sources files since this usage of IFS is unsuable inside make
  3. # (trouble with newlines)
  4. source_files="$@"
  5. OIFS=$IFS
  6. for f in $source_files ; do
  7. IFS='
  8. '
  9. for f in `cat $f` ; do
  10. case $f in
  11. \#*) ;;
  12. *)
  13. # some lines in .sources may contain quick syntax to exclude files i.e.:
  14. # ../dir/*.cs:File1.cs,File2.cs (include everything except File1.cs and File2.cs)
  15. # let's drop that ":files" suffix
  16. for line in `echo $f | cut -d \: -f 1` ; do
  17. echo $line
  18. done
  19. esac
  20. done
  21. OIFS=$IFS
  22. done
  23. IFS=$OIFS