39 lines
1.0 KiB
Makefile
39 lines
1.0 KiB
Makefile
prefix = /usr
|
|
SRCS = $(wildcard src/*.c)
|
|
HEADERS = $(wildcard src/*.h)
|
|
PO_DIRS = $(wildcard locale/*/*)
|
|
PO_FILES = $(wildcard locale/*/*/*.po)
|
|
|
|
dist/xcfg: $(SRCS) $(HEADERS) $(PO_FILES)
|
|
mkdir -p dist
|
|
gcc $(CFLAGS) $(SRCS) -o $@ -lncurses -lmenu -lm
|
|
mkdir -p locale
|
|
xgettext -k_ -c $(SRCS) -o locale/xcfg.pot
|
|
@for po in $(PO_DIRS) ; do \
|
|
mv $$po/xcfg.po $$po/mp.old.po ; \
|
|
if msgmerge $$po/mp.old.po locale/xcfg.pot -o $$po/xcfg.po ; then \
|
|
rm $$po/mp.old.po ; \
|
|
echo "merge success: $$po/xcfg.po" ; \
|
|
else \
|
|
echo "merge failed: $$po/xcfg.po" ; \
|
|
mv $$po/mp.old.po $$po/xcfg.po ; \
|
|
fi; \
|
|
done
|
|
@for po in $(PO_DIRS) ; do \
|
|
msgfmt $$po/xcfg.po -o $$po/xcfg.mo ; \
|
|
done
|
|
|
|
install:
|
|
mkdir -p $(DESTDIR)$(prefix)/bin
|
|
install -m755 dist/xcfg $(DESTDIR)$(prefix)/bin/xcfg
|
|
@for po in $(PO_DIRS) ; do \
|
|
echo "installing locale: $$po/xcfg.mo" ; \
|
|
mkdir -pv $(DESTDIR)/usr/share/$$po ; \
|
|
cp $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
|
|
done
|
|
|
|
uninstall:
|
|
rm $(DESTDIR)$(prefix)/bin/xcfg
|
|
|
|
.PHONY: install uninstall
|