summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2016-12-22 20:41:02 +0000
committerrofl0r <retnyg@gmx.net>2016-12-22 21:12:23 +0000
commit295330b83f1731b65dbe6c552304fa9e1a9ace15 (patch)
treeabf32b7b5e11062b15d960ac877f4680df6b9041 /Makefile
parent18f7b980d1b9629136635cb79631faf71eaadd32 (diff)
downloadgettext-tiny-295330b83f1731b65dbe6c552304fa9e1a9ace15.tar.gz
initial version of autopoint
all autoconf packages that use gnu gettext for translations require a tool called autopoint in order to run `autoreconf -i`, which is the command to generate the configure script from configure.ac. this is often needed to compile git checkouts of applications, because they usually do not have the configure scripts and the other generated files checked into their version control systems. the autopoint tool is called without parameters, and it is required to copy some m4 files into place and generate some other files. this version here was created just by observing which error messages would be thrown after running it and gradually adding functionality. it was tested on a git checkout of weechat, and later on the source tarballs of various packages like glib, and it seemed to work so far. it's very likely that in future new scenarios will show up that require additional files, but what we have right now is a good start. the m4 files were taken from gnu gettext 0.18, and they are all licensed under very liberal conditions. each file has the original copyright header. there's only one m4 file i wrote myself, which is configheader.m4, supplying a macro i couldn't otherwise find in gettext's source code.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4028bcf..bd709d4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ bindir=$(prefix)/bin
includedir=$(prefix)/include
libdir=$(prefix)/lib
sysconfdir=$(prefix)/etc
+m4dir=$(prefix)/share/gettext-tiny
LIBSRC = $(sort $(wildcard libintl/*.c))
PROGSRC = $(sort $(wildcard src/*.c))
@@ -17,7 +18,8 @@ HEADERS = libintl.h
ALL_INCLUDES = $(HEADERS)
ALL_LIBS=libintl.a
-ALL_TOOLS=msgfmt msgmerge xgettext
+ALL_TOOLS=msgfmt msgmerge xgettext autopoint
+ALL_M4S=$(sort $(wildcard m4/*.m4))
CFLAGS=-O0 -fPIC
@@ -31,7 +33,7 @@ BUILDCFLAGS=$(CFLAGS)
all: $(ALL_LIBS) $(ALL_TOOLS)
-install: $(ALL_LIBS:lib%=$(DESTDIR)$(libdir)/lib%) $(ALL_INCLUDES:%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:%=$(DESTDIR)$(bindir)/%)
+install: $(ALL_LIBS:lib%=$(DESTDIR)$(libdir)/lib%) $(ALL_INCLUDES:%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:%=$(DESTDIR)$(bindir)/%) $(ALL_M4S:%=$(DESTDIR)$(m4dir)/%)
clean:
rm -f $(ALL_LIBS)
@@ -55,6 +57,9 @@ msgfmt: $(OBJS)
xgettext:
cp src/xgettext.sh ./xgettext
+autopoint: src/autopoint.in
+ cat $< | sed 's,@m4dir@,$(m4dir),' > $@
+
$(DESTDIR)$(libdir)/%.a: %.a
install -D -m 755 $< $@
@@ -64,6 +69,9 @@ $(DESTDIR)$(includedir)/%.h: include/%.h
$(DESTDIR)$(bindir)/%: %
install -D -m 755 $< $@
+$(DESTDIR)$(m4dir)/%: %
+ install -D -m 644 $< $@
+
.PHONY: all clean install