about summary refs log tree commit diff
path: root/MakeTAGS
diff options
context:
space:
mode:
Diffstat (limited to 'MakeTAGS')
-rw-r--r--MakeTAGS46
1 files changed, 44 insertions, 2 deletions
diff --git a/MakeTAGS b/MakeTAGS
index a442ce8d1e..fff024173b 100644
--- a/MakeTAGS
+++ b/MakeTAGS
@@ -1,6 +1,6 @@
 # Make the TAGS files.
 
-# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -98,7 +98,7 @@ ifdef subdir
 ifdef tags_sources
 	$(ETAGS) -o $@ $^
 else
-# No sources.  Create a dummy file. 
+# No sources.  Create a dummy file.
 	touch $@
 endif # tags_sources
 else # parent
@@ -114,3 +114,45 @@ $(subdirs:%=%/TAGS):
 	$(MAKE) -C $(@D) no_deps=t $(@F)
 
 endif # subdir
+
+ifndef XGETTEXT
+XGETTEXT = xgettext
+endif
+ifndef MSGJOIN
+MSGJOIN = msgjoin
+endif
+
+P = $(..)po
+
+ifdef subdir
+domain = $(subdir)
+else
+domain = libc-top
+endif
+
+define extract
+@rm -f $@.new
+$(XGETTEXT) --keyword=_ --keyword=N_ --sort-output -d - \
+	    > $@.new /dev/null $^
+mv -f $@.new $@
+endef
+
+$P/$(domain).pot: $(tags_sources); $(extract)
+
+$P/siglist.pot: $(..)sysdeps/generic/signame.c; $(extract)
+$P/errlist.pot: $(..)sysdeps/mach/hurd/errlist.c; $(extract)
+
+all-pot = $P/libc-top.pot $(subdirs:%=$P/%.pot) \
+	  $P/siglist.pot $P/errlist.pot
+
+ifndef subdir
+$P/SYS_libc.pot: $(all-pot)
+	@rm -f $@.new
+	$(MSGJOIN) $^ > $@.new
+	mv -f $@.new $@
+	test ! -d CVS || cvs ci -m'Regenerated from source files' $@
+
+$(subdirs:%=$P/%.pot): $P/%.pot: FORCE
+	$(MAKE) -C $* no_deps=t ../$@
+FORCE:
+endif