File: build-auto.sh

package info (click to toggle)
schism 2%2B20061016-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,824 kB
  • ctags: 5,402
  • sloc: ansic: 32,841; cpp: 22,411; sh: 5,003; objc: 381; makefile: 234
file content (66 lines) | stat: -rw-r--r-- 2,422 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
#
# this script builds all of the "auto" headers
#

## make help text
echo "making include/auto/helptext.h" >&2
tempfile="include/auto/.helptext.tmp"
while read REPLY; do
	set $REPLY
	cat helptext/$1
	awk 'BEGIN { printf "%c", 0 }' < /dev/null
	echo "	helptext/$1" >&2
done > $tempfile < helptext/index
tempfile2="include/auto/.helptext.h"

echo "/* this file should only be included by helptext.c */" > $tempfile2
sh scripts/bin2h.sh -n help_text -t 'static unsigned char' $tempfile >> $tempfile2 || exit 1
mv "$tempfile2" "include/auto/helptext.h" || exit 1

echo "making include/auto/helpenum.h" >&2
echo "enum {" > $tempfile || exit 1
while read REPLY; do
	set $REPLY
	echo "HELP_$2,"
	echo "	$2" >&2
done >> $tempfile < helptext/index
echo "HELP_NUM_ITEMS" >> $tempfile || exit 1
echo "};" >> $tempfile || exit 1
mv "$tempfile" "include/auto/helpenum.h" || exit 1



## make WM icon
echo "making include/auto/schismico.h" >&2
pngtopnm -alpha < icons/schism-icon-32.png >.a.tmp || exit 1
pngtopnm < icons/schism-icon-32.png >.b.tmp || exit 1
ppmtoxpm -hexonly -name _schism_icon_xpm -alphamask .a.tmp < .b.tmp > .c.tmp || exit 1
rm -f .a.tmp .b.tmp
mv .c.tmp include/auto/schismico.h

## make schism logo
echo "making include/auto/logoschism.h" >&2
pngtopnm -alpha < icons/schism_logo.png > .a.tmp || exit 1
pngtopnm < icons/schism_logo.png > .b.tmp || exit 1
ppmtoxpm -hexonly -name _logo_schism_xpm -alphamask .a.tmp < .b.tmp > .c.tmp || exit 1
rm -f .a.tmp .b.tmp
mv .c.tmp include/auto/logoschism.h

## make IT logo
echo "making include/auto/logoit.h" >&2
pngtopnm -alpha < icons/it_logo.png > .a.tmp || exit 1
pngtopnm < icons/it_logo.png > .b.tmp || exit 1
ppmtoxpm -hexonly -name _logo_it_xpm -alphamask .a.tmp < .b.tmp > .c.tmp || exit 1
rm -f .a.tmp .b.tmp || exit 1
mv .c.tmp include/auto/logoit.h

## make default (builtin) font
echo "making include/auto/default-font.h" >&2
tempfile="include/auto/.tempf.tmp"
echo '/* this file should only be included by draw-char.c */' > $tempfile || exit 1
sh scripts/bin2h.sh -n font_default_lower font/default-lower.fnt >> $tempfile || exit 1
sh scripts/bin2h.sh -n font_default_upper_itf font/default-upper-itf.fnt >> $tempfile || exit 1
sh scripts/bin2h.sh -n font_default_upper_alt font/default-upper-alt.fnt >> $tempfile || exit 1
sh scripts/bin2h.sh -n font_half_width font/half-width.fnt >> $tempfile || exit 1
mv $tempfile include/auto/default-font.h