modules-pro 675 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh -e
  2. #
  3. # modules-pro - Merge template and list of libraries to a profile
  4. #
  5. # Copyright 2012 by Werner Almesberger
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. usage()
  13. {
  14. echo "usage: $0 template.pro module-basename ..." 1>&2
  15. exit 1
  16. }
  17. scan_fped()
  18. {
  19. for n in "$@"; do
  20. fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2
  21. done
  22. }
  23. [ -r "$1" ] || usage
  24. sed /LibName1/Q "$1"
  25. shift
  26. echo "$@" | tr ' ' '\012' | sort -f | awk '{ n++; print "LibName" n "=" $0 }'