PROG = majordom OBJS = continuous.o tts.o natural_cmd.o cmd_lib.o agent.o majordom.o PKGS = pocketsphinx sphinxbase CFLAGS = -Wall -I. -I /usr/local/include/pocketsphinx -I /usr/local/include/sphinxbase -g -O0 -pthread CFLAGS += `pkg-config --cflags $(PKGS)` LDFLAGS = -L /usr/local/lib -L. -pthread LOADLIBS = -lsphinxbase -lsphinxad -lpocketsphinx -lespeak -lfstrcmp -L. -lxaal -luuid -ljson-c -lcbor -lsodium LDLIBS += `pkg-config --libs $(PKGS)` SHELL = /bin/bash all: $(PROG) $(PROG): $(OBJS) $(LINK.c) $^ $(LOADLIBS) $(LDLIBS) -o $@ clean: -rm -f $(OBJS) *~ proper: clean uninstall -rm -f $(PROG) majordom.db metadata.db xaal-$(PROG).service test: $(PROG) LD_LIBRARY_PATH+=:. ./$(PROG) -logfn /dev/null -inmic yes -hmm /usr/local/share/pocketsphinx/model/fr/cmusphinx-fr-ptm-8khz-5.2 -dict ./corpus.dic -lm ./corpus.lm -address 224.0.29.200 -port 1235 -secret xaal # LD_LIBRARY_PATH+=:. ./$(PROG) -logfn /dev/null -inmic yes -hmm /usr/share/pocketsphinx/model/hmm/fr_FR/lium_french_f0 -dict ./corpus.dic -lm ./corpus.lm -secret my_secret Makefile.dep: $(OBJS:.o=.c) $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep $(PROG).pot: $(OBJS:.o=.c) xgettext --copyright-holder="Christophe Lohr" --package-name=$(PROG) --package-version=1 --msgid-bugs-address=christophe.lohr@imt-atlantique.fr -o $@ $^ fr.po: $(PROG).pot if [ -e $@ ]; then mv -f $@ old_$@; fi msginit -i $< -o $@ if [ -e old_$@ ]; then msgcat -o $@ $@ old_$@; fi -joe $@ || vi $@ fr.mo: fr.po msgfmt -o $@ $< pulse: pavucontrol & arecord -r 16000 -f S16_LE - | aplay -r 8000 -f S16_LE - .svnignore: echo $(PROG).o $(PROG) $(OBJS) xaal-$(PROG).service | tr ' ' '\012' > $@ svnignore: .svnignore svn propset svn:ignore -F $< . .PHONY: all clean proper install uninstall svnignore test pulse .SUFFIXES: .mo .po .service .service.in install: xaal-$(PROG).service $(PROG) sudo systemctl --system --now enable $(PWD)/$< xaal-%.service: %.service.in envsubst < $< > $@ uninstall: -if systemctl --system --quiet is-enabled xaal-$(PROG) &>/dev/null ; then \ sudo systemctl --system --now disable xaal-$(PROG) ; \ fi status: -sudo systemctl --system --no-pager -l status xaal-$(PROG)