3 # This script is supposed to recreate all device libraries and their
4 # accompanying header files from the gputils' header/*.inc files
5 # using sdcc/support/scripts/inc2h.pl.
7 # The devices to be created are listed in ./devices.txt, the output
8 # files will be located in ./build/, which is created before use.
10 # (c) 2007 by Raphael Neider <rneider @ web.de>
11 # This file is published under the terms of the GPLv2.
13 GPUTILS
=$HOME/gputils.svn
14 SDCC
=$HOME/sdcc
/sdcc.svn
16 HEADERS
=$SDCC/device
/non-free
/include
/pic14
18 if [ ! -d "$GPUTILS" ]; then
19 echo "gputils not found in '$GPUTILS' -- exiting.";
23 if [ ! -d "$SDCC" ]; then
24 echo "sdcc not found in '$SDCC' -- exiting.";
30 cp ..
/pic14ports.txt .
33 sed -e 's/\s*#.*$//' ..
/devices.txt |
grep -v '^\s*$' |
while read PROC
; do
34 echo "### Generating files for $PROC ...";
36 if grep -q 'NO_LEGACY_NAMES' "$HEADERS/pic${PROC}.h" >/dev
/null
2>&1; then
39 $SDCC/support
/scripts
/inc2h.pl
$PROC $GPUTILS $EMIT_LEGACY_NAMES;
49 echo "### Checking $i and $h ...";
50 if [ -f "../$i" ]; then
52 if diff -wup "../$i" "$i"; then
59 if [ -f "$HEADERS/$h" ]; then
61 if diff -wup "$HEADERS/$h" "$h"; then
68 if [ "x$newc$newh" = "x11" ]; then
69 # new device -- copy into place
70 echo "Installing new files ...";
72 mv -f "$h" "$HEADERS/$h";
73 elif [ "x$differs" = "x0" ]; then
74 # identical files -- ignore
75 echo "No change -- keeping files ...";
79 while [ ! xyes
= "x$ok" ]; do
80 echo "Replace? [y/n]";
86 mv -f "$h" "$HEADERS/$h";