New_subdir 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh -
  2. # Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
  3. # This file is part of the Linux-8086 C library and is distributed
  4. # under the GNU Library General Public License.
  5. cat <<!
  6. This is a shell script to create the bare bones for a new part of the
  7. libc package. To use it you just invoke it with the directory name
  8. you want to create as it's argument, it'll then create that directory
  9. and put a few files in it.
  10. !
  11. if [ "$1" = "" ] ; then exit 1 ; fi
  12. if [ -e "$1" ]
  13. then echo "There is already something called '$1' in the current directory"
  14. echo "You'll have to remove it or rename it first"
  15. exit 1
  16. fi
  17. YEAR=`date +%Y`
  18. NAME="`finger -s $LOGNAME | head -2 | tail -1 | cut -b10-30 | sed 's/ *$//'`"
  19. EMAIL="$LOGNAME@`hostname -f`"
  20. FNAME="`echo $NAME | cut -d\ -f1`"
  21. mkdir $1
  22. cat <<! > $1/Makefile
  23. # Copyright (C) $YEAR $NAME <$EMAIL>
  24. # This file is part of the Linux-8086 C library and is distributed
  25. # under the GNU Library General Public License.
  26. OBJ=$1.o
  27. CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
  28. all: $(LIBC)($(OBJ))
  29. @:
  30. clean:
  31. rm -f *.o libc.a
  32. !
  33. cat <<! > $1/README
  34. Copyright (C) $YEAR $NAME <$EMAIL>
  35. This file is part of the Linux-8086 C library and is distributed
  36. under the GNU Library General Public License.
  37. There's currently nothing special about $1.
  38. -$FNAME
  39. !
  40. cat <<! > $1/$1.c
  41. /* Copyright (C) $YEAR $NAME <$EMAIL>
  42. * This file is part of the Linux-8086 C library and is distributed
  43. * under the GNU Library General Public License.
  44. */
  45. $1()
  46. {
  47. /* FIXME :-) */
  48. }
  49. !
  50. echo "Ok, the directory $1 has now been created ..."
  51. exit 0