struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / recreate.sh
blobaba16d2b43596bada17b0c271bbb574bd649b1b9
1 #!/bin/sh
3 # This script can be used to recreate the device library files from
4 # gputils' .inc files.
5 # Usage:
6 # mkdir temp && cd temp && ../recreate.sh
8 # You will need to adjust the paths to SDCC and gputils before running!
10 GPUTILS=$HOME/svn/gputils
11 SDCC=$HOME/svn/plain
13 is_in()
15 local f l j
16 f=$1
17 shift
18 l=$*
20 for j in $l; do
21 if [ $f = $j ]
22 then
23 return 0
25 done
27 return 1
30 NO_LEGACY_NAMES=
32 for i in ../pic*.h
34 if ! is_in $i ../pic14regs.h ../pic16fam.h ]
35 then
36 test -e $i && grep -q NO_LEGACY_NAMES $i && NO_LEGACY_NAMES="$NO_LEGACY_NAMES $i"
38 done
40 for i in ../pic*.h
42 if ! is_in $i ../pic14regs.h ../pic16fam.h ]
43 then
44 if is_in $i $NO_LEGACY_NAMES
45 then
46 emit_legacy_names=1
47 else
48 emit_legacy_names=
50 DEV=`echo "$i" | sed -e "s:../pic::;s/\.h//"`;
51 echo "Creating ${DEV} ${emit_legacy_names}...";
52 "${SDCC}/support/scripts/inc2h.pl" "${DEV}" "${GPUTILS}" "${emit_legacy_names}";
54 done