1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
# Package name and version number:
dist = faust2pd-$(version)
version = 2.5
# Default installation prefix:
prefix = /usr/local
# Try to guess the Pd installation prefix:
pdprefix = $(patsubst %/bin/pd,%,$(shell which pd 2>/dev/null))
ifeq ($(strip $(pdprefix)),)
# Fall back to /usr/local.
pdprefix = /usr/local
endif
bindir = $(prefix)/bin
# where to install the Pd stuff
libdir = $(pdprefix)/lib
datadir = $(libdir)/pd/extra
# Try to guess the host system type and do platform-specific setup.
host = $(shell ./config.guess)
ifneq "$(findstring -mingw,$(host))" ""
# Windows
EXE = .exe
endif
DESTDIR=
DISTFILES = Makefile COPYING ChangeLog README config.guess *.pure *.pd examples/README examples/*/Makefile examples/*/*.dsp examples/*/*.syn examples/*/*.pd examples/*/*.pure examples/*/*.xml
SEDFILES = README
.PHONY: all examples clean distclean realclean install uninstall
all: faust2pd$(EXE)
examples: faust2pd$(EXE)
for x in basic faust synth seqdemo; do make -C examples/$$x all; done
clean:
rm -f faust2pd$(EXE)
for x in basic faust synth seqdemo; do make -C examples/$$x clean; done
distclean:
rm -f faust2pd$(EXE)
for x in basic faust synth seqdemo; do make -C examples/$$x distclean; done
realclean:
rm -f faust2pd$(EXE)
for x in basic faust synth seqdemo; do make -C examples/$$x realclean; done
# as of pure-0.21, we can compile the script to an executable
faust2pd$(EXE): faust2pd.pure faustxml.pure
sed -e 's?@version@?$(version)?' < $< > xx$<
pure -c xx$< -o $@
rm -f xx$<
# install faust2pd
install:
test -d $(DESTDIR)$(bindir) || mkdir -p $(DESTDIR)$(bindir)
cp faust2pd$(EXE) $(DESTDIR)$(bindir)
strip $(DESTDIR)$(bindir)/faust2pd$(EXE)
ifeq "$(findstring -mingw,$(host))" ""
chmod a+x $(DESTDIR)$(bindir)/faust2pd$(EXE)
endif
@echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@echo "Optionally, you can also run make install-pd to install the auxiliary Faust"
@echo "abstractions in $(DESTDIR)$(datadir)."
@echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
# install the auxiliary Faust abstractions (faust-*.pd)
install-pd:
test -d $(DESTDIR)$(datadir) || mkdir -p $(DESTDIR)$(datadir)
cp faust-*.pd $(DESTDIR)$(datadir)
#uninstall
uninstall:
rm -rf $(DESTDIR)$(bindir)/faust2pd$(EXE)
rm -f $(DESTDIR)$(datadir)/faust-*.pd
.PHONY: dist distcheck
# roll distribution tarball
date = $(shell date "+%B %-d, %Y")
datesubst = sed -e "s?@version@?$(version)?g" -e "s?|today|?$(date)?g" < $(1) > $(2)
dist:
rm -rf $(dist)
mkdir $(dist) && mkdir $(dist)/examples
for x in basic faust seqdemo synth; do mkdir $(dist)/examples/$$x; done
for x in $(DISTFILES); do ln -sf $$PWD/$$x $(dist)/$$x; done
for x in $(SEDFILES); do rm -f $(dist)/$$x; $(call datesubst,$$PWD/$$x,$(dist)/$$x); done
rm -f $(dist).tar.gz
tar cfzh $(dist).tar.gz $(dist)
rm -rf $(dist)
distcheck: dist
tar xfz $(dist).tar.gz
cd $(dist) && make all examples && make install install-pd DESTDIR=./BUILD
rm -rf $(dist)
# Generate the documentation.
sources = faustxml.pure
faust2pd.txt: README $(sources)
pure-doc $(sources) | cat README - > $@
|