- awk ' \
- /^Style / { \
- line=$$0; \
- sub(/Style /, "", line); \
- printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
- FILENAME, FNR, line); \
- } \
- /GuiName/ { \
- line=$$0; \
- sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
- printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
- FILENAME, FNR, line); \
- } \
- ' ../lib/layouts/*.layout ../lib/layouts/*.inc > layouts_l10n.pot
-
-$(srcdir)/languages_l10n.pot: $(top_srcdir)/lib/languages
- cd ${srcdir} ; \
- awk ' \
- /^#/ { \
- next; \
- } \
- { \
- match($$0,"\"[^\"]*\""); \
- lang=substr($$0,RSTART,RLENGTH); \
- gsub(/\"/, "", lang); \
- printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
- FILENAME, FNR, lang); \
- } \
- ' ../lib/languages > languages_l10n.pot
-
-$(srcdir)/ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui
- cd ${srcdir} ; \
+ awk -v top_srcdir="$(top_srcdir)" ' \
+ function fixupfilename() \
+ {\
+ return substr(FILENAME, length(top_srcdir "/") + 1);\
+ }\
+ /^Style / { \
+ line=$$0; \
+ sub(/Style /, "", line); \
+ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+ fixupfilename(), FNR, line); \
+ } \
+ /GuiName/ { \
+ line=$$0; \
+ sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
+ gsub(/"/, "", line); \
+ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+ fixupfilename(), FNR, line); \
+ } \
+ /ListName/ { \
+ line=$$0; \
+ sub(/[[:space:]]*ListName[[:space:]]*/, "", line); \
+ gsub(/"/, "", line); \
+ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+ fixupfilename(), FNR, line); \
+ }' \
+ ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc > $@
+
+languages_l10n.pot: $(top_srcdir)/lib/languages
+ awk -v top_srcdir="$(top_srcdir)" ' \
+ function fixupfilename() \
+ {\
+ return substr(FILENAME, length(top_srcdir "/") + 1);\
+ }\
+ /^#/ { \
+ next; \
+ } \
+ { \
+ match($$0,"\"[^\"]*\""); \
+ lang=substr($$0,RSTART,RLENGTH); \
+ gsub(/\"/, "", lang); \
+ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+ fixupfilename(), FNR, lang); \
+ }' \
+ ${top_srcdir}/lib/languages > $@
+
+ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui