2 # Package name and version number:
3 dist = faust2pd-
$(version
)
6 # Default installation prefix:
9 # Try to guess the Pd installation prefix:
10 pdprefix
= $(patsubst %/bin
/pd
,%,$(shell which pd
2>/dev
/null
))
11 ifeq ($(strip $(pdprefix
)),)
12 # Fall back to /usr/local.
16 bindir = $(prefix)/bin
17 # where to install the Pd stuff
18 libdir = $(pdprefix
)/lib
19 datadir = $(libdir)/pd
/extra
21 # Try to guess the host system type and do platform-specific setup.
22 host
= $(shell .
/config.guess
)
23 ifneq "$(findstring -mingw,$(host))" ""
30 DISTFILES
= Makefile COPYING ChangeLog README config.guess
*.pure
*.pd examples
/README examples
/*/Makefile examples
/*/*.dsp examples
/*/*.syn examples
/*/*.pd examples
/*/*.pure examples
/*/*.xml
33 .PHONY
: all examples
clean distclean realclean install uninstall
37 examples
: faust2pd
$(EXE
)
38 for x in basic faust synth seqdemo
; do make
-C examples
/$$x all; done
42 for x in basic faust synth seqdemo
; do make
-C examples
/$$x clean; done
46 for x in basic faust synth seqdemo
; do make
-C examples
/$$x distclean; done
50 for x in basic faust synth seqdemo
; do make
-C examples
/$$x realclean; done
52 # as of pure-0.21, we can compile the script to an executable
53 faust2pd
$(EXE
): faust2pd.pure faustxml.pure
54 sed
-e
's?@version@?$(version)?' < $< > xx
$<
60 test -d
$(DESTDIR
)$(bindir) || mkdir
-p
$(DESTDIR
)$(bindir)
61 cp faust2pd
$(EXE
) $(DESTDIR
)$(bindir)
62 strip $(DESTDIR
)$(bindir)/faust2pd
$(EXE
)
63 ifeq "$(findstring -mingw,$(host))" ""
64 chmod a
+x
$(DESTDIR
)$(bindir)/faust2pd
$(EXE
)
66 @echo
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
67 @echo
"Optionally, you can also run make install-pd to install the auxiliary Faust"
68 @echo
"abstractions in $(DESTDIR)$(datadir)."
69 @echo
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
71 # install the auxiliary Faust abstractions (faust-*.pd)
73 test -d
$(DESTDIR
)$(datadir) || mkdir
-p
$(DESTDIR
)$(datadir)
74 cp faust-
*.pd
$(DESTDIR
)$(datadir)
78 rm -rf
$(DESTDIR
)$(bindir)/faust2pd
$(EXE
)
79 rm -f
$(DESTDIR
)$(datadir)/faust-
*.pd
81 .PHONY
: dist distcheck
83 # roll distribution tarball
85 date
= $(shell date
"+%B %-d, %Y")
86 datesubst
= sed
-e
"s?@version@?$(version)?g" -e
"s?|today|?$(date)?g" < $(1) > $(2)
90 mkdir
$(dist) && mkdir
$(dist)/examples
91 for x in basic faust seqdemo synth
; do mkdir
$(dist)/examples
/$$x; done
92 for x in
$(DISTFILES
); do ln
-sf
$$PWD/$$x $(dist)/$$x; done
93 for x in
$(SEDFILES
); do
rm -f
$(dist)/$$x; $(call datesubst
,$$PWD/$$x,$(dist)/$$x); done
95 tar cfzh
$(dist).
tar.gz
$(dist)
99 tar xfz
$(dist).
tar.gz
100 cd
$(dist) && make
all examples
&& make
install install-pd DESTDIR
=.
/BUILD
103 # Generate the documentation.
105 sources
= faustxml.pure
107 faust2pd.txt
: README
$(sources
)
108 pure-doc
$(sources
) | cat README
- > $@