makeflags.sh

来自「电驴的MAC源代码」· Shell 代码 · 共 60 行

SH
60
字号
#!/bin/sh# Create Makefile.amecho > Makefile.amecho 'EXTRA_DIST = \' >> Makefile.amls *.xpm | sed -e 's/^/\t/' -e 's/$/ \\/' >> Makefile.amecho '	makeflags.sh' >> Makefile.am# Create CountryFlags.h and headerecho > CountryFlags.hecho >> CountryFlags.hecho '#ifndef COUNTRY_FLAGS_H' >> CountryFlags.hecho '#define COUNTRY_FLAGS_H' >> CountryFlags.hecho >> CountryFlags.hecho >> CountryFlags.h# Create include directivesls *.xpm | sed -e 's/^/#include "/' -e 's/$/"/' >> CountryFlags.hecho >> CountryFlags.hecho >> CountryFlags.h# Define the structecho 'struct FlagXPMCode' >> CountryFlags.hecho '{' >> CountryFlags.hecho '	const char **xpm;' >> CountryFlags.hecho '	const char *code;' >> CountryFlags.hecho '};' >> CountryFlags.hecho >> CountryFlags.hecho >> CountryFlags.h# "do" is a reserved word, we can't use it#sed -i -e 's/do\[\]/do_\[\]/' do.xpm# globally used names by wx#sed -i -e 's/ht\[\]/ht_\[\]/' ht.xpm#sed -i -e 's/it\[\]/it_\[\]/' it.xpm#sed -i -e 's/sz\[\]/sz_\[\]/' sz.xpm# Create the flag/Code vectorecho 'static struct FlagXPMCode flagXPMCodeVector[] = {'>> CountryFlags.hls *.xpm | sed -e 's/\.xpm$//;/\//s:.*/\([^/][^/]*\):\1:' | \	sed -e 's/[A-Za-z]*/\t{&, "&"},/' | \	sed -e 's/do/do_/1' |	sed -e 's/ht/ht_/1' |	sed -e 's/it/it_/1' |	sed -e 's/sz/sz_/1' \	>> CountryFlags.hecho '};'>> CountryFlags.hecho >> CountryFlags.hecho >> CountryFlags.h# Calculate the vector sizeecho 'static const int FLAGS_XPM_SIZE = (sizeof flagXPMCodeVector) / (sizeof flagXPMCodeVector[0]);' >> CountryFlags.hecho >> CountryFlags.hecho >> CountryFlags.h# Finishecho '#endif // COUNTRY_FLAGS_H' >> CountryFlags.h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?