From 29f50d6560ab2ba4906b2c853dfc9e70fed3ff88 Mon Sep 17 00:00:00 2001 From: Reece Dunn Date: Mon, 28 Jun 2010 21:00:04 +0100 Subject: [PATCH] build: add an install target. --- Makefile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 023e58a9..a22fa897 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +PREFIX=/usr +BINDIR=$(PREFIX)/bin +DATADIR=$(PREFIX)/share/espeak-data + PLATFORM=big_endian .PHONY: all clean distclean espeak espeakedit espeak-phoneme-data espeak-data espeak-data-local @@ -6,32 +10,37 @@ PLATFORM=big_endian all: espeak espeakedit espeak-data-local +install: + cd src && make DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) install && cd .. + install -m 755 src/espeakedit $(DESTDIR)$(BINDIR) + cp -prf espeak-data-local/* $(DESTDIR)$(DATADIR) + clean: cd src && rm -f *.o *~ && cd .. distclean: clean cd src && rm -f libespeak.a libespeak.so.* speak espeak espeakedit && cd .. - cd platforms/${PLATFORM} && rm -f espeak-phoneme-data && cd ../.. + cd platforms/$(PLATFORM) && rm -f espeak-phoneme-data && cd ../.. rm -rf espeak-data-local ##### build targets: espeak: - cd src && make && cd .. + cd src && make PREFIX=$(PREFIX) && cd .. espeakedit: - cd src && make -f Makefile.espeakedit && cd .. + cd src && make -f Makefile.espeakedit PREFIX=$(PREFIX) && cd .. espeak-phoneme-data: - cd platforms/${PLATFORM} && make && cd ../.. + cd platforms/$(PLATFORM) && make PREFIX=$(PREFIX) && cd ../.. espeak-data: espeakedit - cp -a espeak-data ${HOME}/espeak-data - cp -a phsource ${HOME}/espeak-data/phsource - cp -a dictsource ${HOME}/espeak-data/dictsource + cp -a espeak-data $(HOME)/espeak-data + cp -a phsource $(HOME)/espeak-data/phsource + cp -a dictsource $(HOME)/espeak-data/dictsource src/espeakedit --compile espeak-data-local: espeak-phoneme-data espeak-data - cp -a ${HOME}/espeak-data espeak-data-local - platforms/${PLATFORM}/espeak-phoneme-data espeak-data-local espeak-data-local espeak-data-local/phondata-manifest + cp -a $(HOME)/espeak-data espeak-data-local + platforms/$(PLATFORM)/espeak-phoneme-data espeak-data-local espeak-data-local espeak-data-local/phondata-manifest