| 1 |
version := 2.85.9 |
| 2 |
|
| 3 |
system ?= $(shell uname -s) |
| 4 |
|
| 5 |
-include user.mk |
| 6 |
DESTDIR ?= |
| 7 |
PREFIX ?= /usr/local |
| 8 |
INSTALL_LIBDIR ?= lib |
| 9 |
CROSS=i586-mingw32msvc- |
| 10 |
BUILDLOCATION := build |
| 11 |
DEBUGFOLDER := faustdebug |
| 12 |
BINLOCATION := $(BUILDLOCATION)/bin |
| 13 |
LIBLOCATION := $(BUILDLOCATION)/lib |
| 14 |
|
| 15 |
MAKEFILE := Makefile.unix |
| 16 |
|
| 17 |
prefix := $(DESTDIR)$(PREFIX) |
| 18 |
arch := $(wildcard architecture/*.*) |
| 19 |
mfiles := $(wildcard examples/Makefile.*) |
| 20 |
vname := faust-$(version)-$(shell date +%y%m%d.%H%M%S) |
| 21 |
zname := faust-$(version) |
| 22 |
|
| 23 |
.PHONY: all world benchmark remote ios ios-llvm wasm sound2faust |
| 24 |
|
| 25 |
# The main targets |
| 26 |
|
| 27 |
compiler : updatesubmodules |
| 28 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=regular.cmake TARGETS=regular.cmake |
| 29 |
$(MAKE) -C $(BUILDLOCATION) |
| 30 |
|
| 31 |
most : updatesubmodules |
| 32 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=most.cmake TARGETS=most.cmake |
| 33 |
$(MAKE) -C $(BUILDLOCATION) |
| 34 |
|
| 35 |
developer : updatesubmodules |
| 36 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=all.cmake TARGETS=developer.cmake |
| 37 |
$(MAKE) -C $(BUILDLOCATION) |
| 38 |
|
| 39 |
interp : updatesubmodules |
| 40 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=interp.cmake TARGETS=developer.cmake |
| 41 |
$(MAKE) -C $(BUILDLOCATION) |
| 42 |
|
| 43 |
all : updatesubmodules |
| 44 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=all.cmake TARGETS=all.cmake |
| 45 |
$(MAKE) -C $(BUILDLOCATION) |
| 46 |
|
| 47 |
libsall : updatesubmodules |
| 48 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=regular.cmake TARGETS=all.cmake |
| 49 |
$(MAKE) -C $(BUILDLOCATION) |
| 50 |
|
| 51 |
travis : updatesubmodules |
| 52 |
$(MAKE) -C $(BUILDLOCATION) cmake BACKENDS=backends.cmake TARGETS=regular.cmake |
| 53 |
$(MAKE) -C $(BUILDLOCATION) |
| 54 |
|
| 55 |
# Universal and native: special developer modes |
| 56 |
|
| 57 |
universal : |
| 58 |
$(MAKE) -C $(BUILDLOCATION) universal |
| 59 |
@echo |
| 60 |
@echo "### Universal mode is ON" |
| 61 |
@echo "### You need to recompile" |
| 62 |
@echo "### Use 'make native' to revert" |
| 63 |
|
| 64 |
native : |
| 65 |
$(MAKE) -C $(BUILDLOCATION) native |
| 66 |
@echo |
| 67 |
@echo "### Universal mode is OFF" |
| 68 |
@echo "### You need to recompile" |
| 69 |
|
| 70 |
# make world (MAINTAINERS TARGET): This builds all the common targets for a |
| 71 |
# fairly complete Faust installation: Faust compiler (including the LLVM |
| 72 |
# backend) and library, sound2faust utility, OSC and HTTPD libraries (both |
| 73 |
# static and dynamic). |
| 74 |
|
| 75 |
# CAVEAT: END USERS should note that this target requires a substantial amount |
| 76 |
# of additional dependencies (in particular, LLVM) which aren't readily |
| 77 |
# pre-installed on most systems, hence you should NOT use this target (which |
| 78 |
# is mostly aimed at package maintainers) unless you KNOW WHAT YOU'RE DOING. |
| 79 |
# Don't complain if the target doesn't build for you, use one of the standard |
| 80 |
# build targets instead. You have been warned! :) |
| 81 |
|
| 82 |
# MAINTAINERS: Once the "remote" target is readily supported on most |
| 83 |
# platforms, it should be added here. This requires Jack2 1.9.10 or later |
| 84 |
# which isn't regularly installed on most systems at present, so we skip this |
| 85 |
# target for now. |
| 86 |
|
| 87 |
world : all |
| 88 |
$(MAKE) -C tools/sound2faust |
| 89 |
|
| 90 |
benchmark : developer |
| 91 |
$(MAKE) -C tools/benchmark all |
| 92 |
|
| 93 |
remote : developer |
| 94 |
$(MAKE) -C embedded/faustremote/RemoteServer all |
| 95 |
$(MAKE) -C embedded/faustremote all |
| 96 |
|
| 97 |
debug : |
| 98 |
$(MAKE) -C $(BUILDLOCATION) FAUSTDIR=faustdebug RELEASE_TYPE=Debug NONDETERMINISM_LINT=yes |
| 99 |
# $(MAKE) -C compiler debug -f $(MAKEFILE) prefix=$(prefix) |
| 100 |
|
| 101 |
ioslib : |
| 102 |
$(MAKE) -C $(BUILDLOCATION) ioslib |
| 103 |
|
| 104 |
wasm : |
| 105 |
$(MAKE) -C $(BUILDLOCATION) wasmlib |
| 106 |
$(MAKE) -C $(BUILDLOCATION) cmake WORKLET=on |
| 107 |
$(MAKE) -C $(BUILDLOCATION) wasmglue |
| 108 |
# Hack : be sure to use LIB_NAME define in build/wasmglue/CMakeLists.txt |
| 109 |
echo "export default FaustModule;" >> $(BUILDLOCATION)/lib/libfaust-worklet-glue.js |
| 110 |
# Fix for EMCC codegen bug |
| 111 |
echo "var tempDouble, tempI64;" >> $(BUILDLOCATION)/lib/libfaust-worklet-glue.js |
| 112 |
$(MAKE) -C $(BUILDLOCATION) cmake WORKLET=off |
| 113 |
$(MAKE) -C $(BUILDLOCATION) wasmglue |
| 114 |
|
| 115 |
sound2faust : |
| 116 |
$(MAKE) -C tools/sound2faust |
| 117 |
|
| 118 |
.PHONY: clean install uninstall dist parser help format |
| 119 |
|
| 120 |
help : |
| 121 |
@echo "===== Faust main makefile =====" |
| 122 |
@echo "Main targets" |
| 123 |
@echo " 'compiler' (def): builds the Faust compiler (without the LLVM backend), and the Faust osc and httpd libraries" |
| 124 |
@echo " 'most' : builds the Faust compiler with LLVM backend and every static libraries" |
| 125 |
@echo " 'developer' : builds the Faust compiler with every possible backends and every static libraries" |
| 126 |
@echo " 'all' : builds the Faust compiler with every possible backends and every static and dynamic libraries" |
| 127 |
@echo " 'libsall' : builds the Faust compiler (without the LLVM backend) and includes all the static and dynamic libraries" |
| 128 |
@echo |
| 129 |
@echo " 'install' : install the compiler, tools and the architecture files in $(prefix)/bin $(prefix)/share/faust $(prefix)/include/faust" |
| 130 |
@echo " 'clean' : remove all object files (but keep build configurations)" |
| 131 |
@echo " 'distclean' : clean everything by removing the build/faustdir folder" |
| 132 |
@echo |
| 133 |
@echo "Other targets" |
| 134 |
@echo " 'debug' : similar to 'all' target but with debug info. Output is in $(BUILDLOCATION)/$(DEBUGFOLDER)" |
| 135 |
@echo " 'wasm' : builds the Faust WebAssembly libraries" |
| 136 |
@echo " 'benchmark' : builds the benchmark tools (see tools/benchmark)" |
| 137 |
@echo " 'remote' : builds the libfaustremote.a library and the Faust RemoteServer" |
| 138 |
@echo " 'sound2faust' : builds the sound2faust utilities (requires libsndfile)" |
| 139 |
@echo " 'parser' : generates the parser from the lex and yacc files" |
| 140 |
@echo " 'interp' : generates static libfaust with the Interp backend only" |
| 141 |
@echo |
| 142 |
@echo "Distribution target" |
| 143 |
@echo " 'world' : the 'all' target and sound2faust" |
| 144 |
@echo |
| 145 |
@echo "Platform specific targets:" |
| 146 |
@echo " 'universal' : [MacOSX] switch to universal binaries mode" |
| 147 |
@echo " 'native' : [MacOSX] switch to native mode" |
| 148 |
@echo " 'ioslib' : [iOS] build the Faust static library for iOS" |
| 149 |
@echo |
| 150 |
@echo "Utilities targets:" |
| 151 |
@echo " 'man' : generate the Faust man page" |
| 152 |
@echo " 'doc' : generate the documentation using doxygen" |
| 153 |
@echo " 'doclib' : generate the documentation of the Faust libraries" |
| 154 |
@echo " 'updatesubmodules' : update the libraries submodule" |
| 155 |
@echo " 'devinstall' : install the benchmark tools" |
| 156 |
@echo " 'uninstall' : undo what install did" |
| 157 |
@echo " 'dist' : make a Faust distribution as a .zip file" |
| 158 |
@echo " 'log' : make a changelog file" |
| 159 |
@echo " 'format' : clang-format all src files" |
| 160 |
@echo |
| 161 |
|
| 162 |
readme: |
| 163 |
@cat resources/man-header.txt |
| 164 |
@build/bin/faust -h | sed -e 's/\(-[a-zA-Z][a-zA-Z]*\)/**\1**/' \ |
| 165 |
| sed -e 's/\(--[a-zA-Z][a-zA-Z-]*\)/**\1**/' \ |
| 166 |
| sed -e 's/</\\</g' \ |
| 167 |
| sed '/-----*/ G' \ |
| 168 |
| sed '/\.$$/ G' |
| 169 |
@cat resources/man-footer.txt |
| 170 |
|
| 171 |
|
| 172 |
parser : |
| 173 |
$(MAKE) -C compiler/parser |
| 174 |
|
| 175 |
clean : |
| 176 |
$(MAKE) -C build clean |
| 177 |
$(MAKE) -C embedded/faustremote/RemoteServer clean |
| 178 |
$(MAKE) -C embedded/faustremote clean |
| 179 |
$(MAKE) -C tools/sound2faust clean |
| 180 |
$(MAKE) -C tools/benchmark clean |
| 181 |
|
| 182 |
distclean : |
| 183 |
rm -rf build/faustdir |
| 184 |
|
| 185 |
doc: $(wildcard compiler/*.cpp) $(wildcard compiler/*/*.cpp) $(wildcard compiler/*/*.h) $(wildcard compiler/*/*.hh) |
| 186 |
cd documentation/libfaust && doxygen |
| 187 |
cd documentation/libfaustremote && doxygen |
| 188 |
cd documentation/compiler && doxygen |
| 189 |
|
| 190 |
|
| 191 |
format : |
| 192 |
find compiler -path compiler/parser -prune -o -iname '*.cpp' -execdir clang-format -i -style=file {} \; |
| 193 |
find compiler -path compiler/parser -prune -o -iname '*.hh' -execdir clang-format -i -style=file {} \; |
| 194 |
find compiler -path compiler/parser -prune -o -iname '*.h' -execdir clang-format -i -style=file {} \; |
| 195 |
|
| 196 |
# the target 'lib' can be used to init and update the libraries submodule |
| 197 |
updatesubmodules : |
| 198 |
if test -d .git; then git submodule update --init --recursive; fi |
| 199 |
|
| 200 |
|
| 201 |
doclib : updatesubmodules |
| 202 |
./libraries/generateDoc |
| 203 |
|
| 204 |
man : |
| 205 |
make -C documentation/man man |
| 206 |
|
| 207 |
install : |
| 208 |
make -C $(BUILDLOCATION) install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) |
| 209 |
|
| 210 |
uninstall : |
| 211 |
make -C $(BUILDLOCATION) uninstall |
| 212 |
|
| 213 |
|
| 214 |
# install benchmark tools |
| 215 |
devinstall: |
| 216 |
$(MAKE) -C tools/benchmark install |
| 217 |
|
| 218 |
# make a Faust distribution tarball |
| 219 |
dist = faust-$(version) |
| 220 |
submodules = libraries tools/faust2ck |
| 221 |
dist : |
| 222 |
rm -rf $(dist) |
| 223 |
# Make sure that the submodules are initialized. |
| 224 |
git submodule update --init |
| 225 |
# Grab the main source. |
| 226 |
git archive --format=tar.gz --prefix=$(dist)/ HEAD | tar xfz - |
| 227 |
# Grab the submodules. |
| 228 |
for x in $(submodules); do (cd $(dist) && rm -rf $$x && git -C ../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done |
| 229 |
# Create the source tarball. |
| 230 |
tar cfz $(dist).tar.gz $(dist) |
| 231 |
rm -rf $(dist) |
| 232 |
|
| 233 |
# this does the same, but uses the $(debversion) instead (see below) which |
| 234 |
# includes the actual git revision number and hash (useful for git snapshots) |
| 235 |
dist-snapshot : |
| 236 |
$(MAKE) dist dist=faust-$(debversion) |
| 237 |
|
| 238 |
log : |
| 239 |
git log --oneline --date-order --reverse --after={2014-05-19} master >log-$(version) |
| 240 |
|
| 241 |
# Make Debian packages. This builds a package from the current HEAD in a |
| 242 |
# subdirectory named $(debdist). It also creates the source archive that goes |
| 243 |
# along with it. All files will be created in the toplevel Faust source |
| 244 |
# directory. |
| 245 |
|
| 246 |
# To make this work, you need to have the Debian package toolchain (debuild |
| 247 |
# and friends) installed. Also make sure you have your DEBEMAIL and |
| 248 |
# DEBFULLNAME environment variables set up as explained in the debchange(1) |
| 249 |
# manual page. These are needed to create changelog entries and in order to |
| 250 |
# sign the Debian packages created with 'make deb' and 'make debsrc'. |
| 251 |
|
| 252 |
# The typical workflow is as follows: |
| 253 |
|
| 254 |
# 1. Run 'make debchange' once to create a new debian/changelog entry. You |
| 255 |
# *must* do this once so that debuild knows about the proper version number of |
| 256 |
# the package. |
| 257 |
|
| 258 |
# 2. Run 'make deb' to build a signed binary package. Or 'make deb-us' for an |
| 259 |
# unsigned one. |
| 260 |
|
| 261 |
# If you only need the binary package for local deployment then you're done. |
| 262 |
# Otherwise proceed to step 3. |
| 263 |
|
| 264 |
# 3. Run 'make debsrc' to create a signed Debian source package which can be |
| 265 |
# uploaded, e.g, to Launchpad using 'dput'. Or 'make debsrc-us' for an |
| 266 |
# unsigned package. |
| 267 |
|
| 268 |
# 4. Run 'make debclean' to get rid of any files that were created in steps 2 |
| 269 |
# and 3. |
| 270 |
|
| 271 |
# The Debian version gets derived from the package version $(version) as well |
| 272 |
# as the date and serial number of the last commit. |
| 273 |
debversion = $(version)+git$(shell git log -1 --format=%cd --date=short 2>/dev/null | sed -e 's/-//g')+$(shell git rev-list --count HEAD 2>/dev/null) |
| 274 |
# Debian revision number of the package. |
| 275 |
debrevision = 1 |
| 276 |
# Source tarball and folder. |
| 277 |
debsrc = faust_$(debversion).orig.tar.gz |
| 278 |
debdist = faust-$(debversion) |
| 279 |
|
| 280 |
# This is used for automatically generated debian/changelog entries (cf. 'make |
| 281 |
# debchange'). Adjust as needed. |
| 282 |
debmsg = "Build from latest upstream source." |
| 283 |
debprio = "low" |
| 284 |
|
| 285 |
.PHONY: debversion debchange debclean deb debsrc deb-us debsrc-us |
| 286 |
|
| 287 |
debversion: |
| 288 |
@echo $(debversion) |
| 289 |
|
| 290 |
debchange: |
| 291 |
dch -u $(debprio) -v $(debversion)-$(debrevision) $(debmsg) && dch -r "" |
| 292 |
|
| 293 |
debclean: |
| 294 |
rm -rf $(debdist) |
| 295 |
rm -f faust_$(version)+git* faust-dbgsym_$(version)+git* |
| 296 |
|
| 297 |
deb: $(debsrc) |
| 298 |
rm -rf $(debdist) |
| 299 |
tar xfz $(debsrc) |
| 300 |
# Here we just copy debian/ from the working copy since it might have changes |
| 301 |
# that haven't been committed yet. |
| 302 |
cd $(debdist) && cp -R ../debian . && debuild $(DEBUILD_FLAGS) |
| 303 |
rm -rf $(debdist) |
| 304 |
|
| 305 |
debsrc: |
| 306 |
$(MAKE) deb DEBUILD_FLAGS=-S |
| 307 |
|
| 308 |
deb-us: |
| 309 |
$(MAKE) deb DEBUILD_FLAGS="-us -uc" |
| 310 |
|
| 311 |
debsrc-us: |
| 312 |
$(MAKE) deb DEBUILD_FLAGS="-S -us -uc" |
| 313 |
|
| 314 |
$(debsrc) : |
| 315 |
rm -rf $(debdist) |
| 316 |
# Make sure that the submodules are initialized. |
| 317 |
git submodule update --init |
| 318 |
# Grab the main source. |
| 319 |
git archive --format=tar.gz --prefix=$(debdist)/ HEAD | tar xfz - |
| 320 |
# Grab the submodules. |
| 321 |
for x in $(submodules); do (cd $(debdist) && rm -rf $$x && git -C ../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done |
| 322 |
# Create the source tarball. |
| 323 |
tar cfz $(debsrc) $(debdist) |
| 324 |
rm -rf $(debdist) |
| 325 |
|
| 326 |
# DO NOT DELETE |