5 echo 'EXTRA_DIST = \' >> Makefile.am
6 ls *.xpm | sed -e 's
/^
/\t/' | sed -e 's
/$
/ \\/' >> Makefile.am
7 echo ' makeflags.sh
' >> Makefile.am
9 # Create CountryFlags.h and header
11 echo >> CountryFlags.h
12 echo '#ifndef COUNTRY_FLAGS_H' >> CountryFlags.h
13 echo '#define COUNTRY_FLAGS_H' >> CountryFlags.h
14 echo >> CountryFlags.h
15 echo >> CountryFlags.h
17 # Create include directives
18 ls *.xpm |
sed -e 's/^/#include "/' |
sed -e 's/$/"/' >> CountryFlags.h
19 echo >> CountryFlags.h
20 echo >> CountryFlags.h
23 echo 'struct FlagXPMCode' >> CountryFlags.h
24 echo '{' >> CountryFlags.h
25 echo ' const char **xpm;' >> CountryFlags.h
26 echo ' const char *code;' >> CountryFlags.h
27 echo '};' >> CountryFlags.h
28 echo >> CountryFlags.h
29 echo >> CountryFlags.h
31 # "do" is a reserved word, we can't use it
32 #sed -i -e 's/do\[\]/do_\[\]/' do.xpm
34 # globally used names by wx
35 #sed -i -e 's/ht\[\]/ht_\[\]/' ht.xpm
36 #sed -i -e 's/it\[\]/it_\[\]/' it.xpm
37 #sed -i -e 's/sz\[\]/sz_\[\]/' sz.xpm
39 # Create the flag/Code vector
40 echo 'static struct FlagXPMCode flagXPMCodeVector[] = {'>> CountryFlags.h
41 ls *.xpm |
xargs -i basename '{}' .xpm | \
42 sed -e 's/[A-Za-z]*/\t{&, "&"},/' | \
48 echo '};'>> CountryFlags.h
49 echo >> CountryFlags.h
50 echo >> CountryFlags.h
52 # Calculate the vector size
53 echo 'static const int FLAGS_XPM_SIZE = (sizeof flagXPMCodeVector) / (sizeof flagXPMCodeVector[0]);' >> CountryFlags.h
54 echo >> CountryFlags.h
55 echo >> CountryFlags.h
58 echo '#endif // COUNTRY_FLAGS_H' >> CountryFlags.h