mkheader.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #! /bin/sh
  2. # Copyright (C) 2001-2022 Free Software Foundation, Inc.
  3. # This file is part of GCC.
  4. # GCC is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # GCC is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with GCC; see the file COPYING3. If not see
  14. # <http://www.gnu.org/licenses/>.
  15. # Print libgcc_tm.h to the standard output.
  16. # DEFINES and HEADERS are expected to be set in the environment.
  17. # Add multiple inclusion protection guard, part one.
  18. echo "#ifndef LIBGCC_TM_H"
  19. echo "#define LIBGCC_TM_H"
  20. # Generate the body of the file
  21. echo "/* Automatically generated by mkheader.sh. */"
  22. for def in $DEFINES; do
  23. echo "#ifndef $def" | sed 's/=.*//'
  24. echo "# define $def" | sed 's/=/ /'
  25. echo "#endif"
  26. done
  27. for file in $HEADERS; do
  28. echo "#include \"$file\""
  29. done
  30. # Add multiple inclusion protection guard, part two.
  31. echo "#endif /* LIBGCC_TM_H */"