summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2012-10-12 10:05:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-12 12:17:09 -0700
commitcfaa5563bf298ea75cdd69f23ab32bc7d222f875 (patch)
tree36502e636e208ff4429098bde6d13a28212cce81 /Makefile
parent920c1e58ffbae2c5855f23c67f8637f14c5687f9 (diff)
downloadsubsurface-cfaa5563bf298ea75cdd69f23ab32bc7d222f875.tar.gz
Better gettext build
My previous take at adding gettext to the Makefile wasn't very good, since it always relinked the subsurface executable. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6ecef7904..e747c5a3b 100644
--- a/Makefile
+++ b/Makefile
@@ -118,11 +118,14 @@ endif
LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) $(LIBZIP) -lpthread -lm
+MSGLANGS=$(notdir $(wildcard po/*po))
+MSGOBJS=$(addprefix locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/subsurface.mo))
+
OBJS = main.o dive.o time.o profile.o info.o equipment.o divelist.o \
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o uemis-downloader.o \
gtk-gui.o statistics.o file.o cochran.o $(OSSUPPORT).o $(RESFILE)
-$(NAME): $(OBJS) gettext
+$(NAME): $(OBJS) $(MSGOBJS)
$(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
install: $(NAME)
@@ -211,12 +214,9 @@ uemis-downloader.o: uemis-downloader.c dive.h uemis.h
$(OSSUPPORT).o: $(OSSUPPORT).c display-gtk.h
$(CC) $(CFLAGS) $(OSSUPPORT_CFLAGS) -c $(OSSUPPORT).c
-gettext: po/*.po
- @for MSG in $(wildcard po/*.po); do \
- LOC=`basename $$MSG .po`; \
- mkdir -p locale/$$LOC.UTF-8/LC_MESSAGES; \
- msgfmt -c -o locale/$$LOC.UTF-8/LC_MESSAGES/subsurface.mo $$MSG; \
- done
+locale/%.UTF-8/LC_MESSAGES/subsurface.mo: po/%.po
+ mkdir -p $(dir $@)
+ msgfmt -c -o $@ po/$*.po
doc:
$(MAKE) -C Documentation doc