First commit
This commit is contained in:
38
Makefile
Normal file
38
Makefile
Normal file
@ -0,0 +1,38 @@
|
||||
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 $@ -lcurses -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/mp.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/mp.mo" ; \
|
||||
mkdir -pv $(DESTDIR)/usr/share/$$po ; \
|
||||
cp $$po/mp.mo $(DESTDIR)/usr/share/$$po ; \
|
||||
done
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(prefix)/bin/xcfg
|
||||
|
||||
.PHONY: install uninstall
|
Reference in New Issue
Block a user