From 07ed78f42a78934e213b367cf82ba55cd331637e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 17:32:55 +0200 Subject: Makefile: Add BINDIR preference --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b631eee..92605f8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .POSIX: PREFIX = /usr/local +BINDIR = $(PREFIX)/bin DEPS = gtk+-3.0 webkit2gtk-4.0 OBJS = badwolf @@ -16,8 +17,8 @@ all: $(OBJS) $(CC) -std=c11 $(CFLAGS) $(CDEPS) -o $@ $< $(LDFLAGS) $(LIBS) install: badwolf - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -p badwolf $(DESTDIR)$(PREFIX)/bin/badwolf + mkdir -p $(DESTDIR)$(BINDIR) + cp -p badwolf $(DESTDIR)$(BINDIR)/badwolf clean: rm $(OBJS) -- cgit v1.3.1-23-gd82d From 7dc84b19ba98cc3f44c5fed97a4913af51546230 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 17:33:51 +0200 Subject: Makefile: Add badwolf.1 to install --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 92605f8..fb4ed31 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ PREFIX = /usr/local BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)/share/man DEPS = gtk+-3.0 webkit2gtk-4.0 OBJS = badwolf @@ -19,6 +20,8 @@ all: $(OBJS) install: badwolf mkdir -p $(DESTDIR)$(BINDIR) cp -p badwolf $(DESTDIR)$(BINDIR)/badwolf + mkdir -p $(DESTDIR)$(MANDIR)/man1 + cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1 clean: rm $(OBJS) -- cgit v1.3.1-23-gd82d From 6dae2b34423f5c00971cc243c97697644c2da143 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Apr 2019 02:12:30 +0200 Subject: Makefile: Add building *.mo on compilation --- Makefile | 33 +++++++++++++++++++++------------ mo/.keep | 0 2 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 mo/.keep (limited to 'Makefile') diff --git a/Makefile b/Makefile index fb4ed31..6b2d20f 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,39 @@ .POSIX: -PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/share/man +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)/share/man +DATADIR = $(PREFIX)/share/badwolf +PACKAGE = Badwolf -DEPS = gtk+-3.0 webkit2gtk-4.0 -OBJS = badwolf +DEPS = gtk+-3.0 webkit2gtk-4.0 +OBJS = badwolf +TRANS = fr.mo -CC = cc -CFLAGS = -g -Wall -Wextra -CDEPS = `pkg-config --cflags $(DEPS)` -LIBS = `pkg-config --libs $(DEPS)` +CC = cc +CFLAGS = -g -Wall -Wextra +CDEPS = `pkg-config --cflags $(DEPS)` -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" +LIBS = `pkg-config --libs $(DEPS)` -all: $(OBJS) +all: $(OBJS) $(TRANS) + +%.mo: + mkdir -p locale/$*/LC_MESSAGES + msgfmt -o locale/$*/LC_MESSAGES/$(PACKAGE).mo po/$*.po .c: $(CC) -std=c11 $(CFLAGS) $(CDEPS) -o $@ $< $(LDFLAGS) $(LIBS) -install: badwolf +install: all mkdir -p $(DESTDIR)$(BINDIR) cp -p badwolf $(DESTDIR)$(BINDIR)/badwolf mkdir -p $(DESTDIR)$(MANDIR)/man1 cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(DATADIR)/locale + cp -r locale/ $(DESTDIR)$(DATADIR) clean: - rm $(OBJS) + rm -fr locale $(OBJS) format: *.c *.h clang-format -style=file -assume-filename=.clang-format -i *.c *.h diff --git a/mo/.keep b/mo/.keep new file mode 100644 index 0000000..e69de29 -- cgit v1.3.1-23-gd82d From 0d4fcf141a67221748881ad0a4be26ad4227a235 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 26 Apr 2019 14:32:45 +0200 Subject: Makefile: Add po/ targets --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6b2d20f..2635716 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,12 @@ all: $(OBJS) $(TRANS) mkdir -p locale/$*/LC_MESSAGES msgfmt -o locale/$*/LC_MESSAGES/$(PACKAGE).mo po/$*.po +po/messages.pot: + xgettext --keyword=_ --language=C -o $@ --add-comments --sort-output -j badwolf.c + +po/%.po: po/messages.pot + msgmerge --update $@ $< + .c: $(CC) -std=c11 $(CFLAGS) $(CDEPS) -o $@ $< $(LDFLAGS) $(LIBS) -- cgit v1.3.1-23-gd82d