Use build_root to generate Makefile

Don't hardcode the buildroot but use the value from meson.

Based on patch by Jan Koester <jan.koester@gmx.net>

Fixes #202
This commit is contained in:
Wim Taymans 2020-01-08 15:41:01 +01:00
parent dfdd664160
commit e29969f937
2 changed files with 20 additions and 19 deletions

View file

@ -1,20 +1,20 @@
all: all:
ninja -C build ninja -C @BUILD_ROOT@
install: install:
ninja -C build install ninja -C @BUILD_ROOT@ install
uninstall: uninstall:
ninja -C build uninstall ninja -C @BUILD_ROOT@ uninstall
clean: clean:
ninja -C build clean ninja -C @BUILD_ROOT@ clean
run: all run: all
SPA_PLUGIN_DIR=build/spa/plugins \ SPA_PLUGIN_DIR=@BUILD_ROOT@/spa/plugins \
PIPEWIRE_MODULE_DIR=build \ PIPEWIRE_MODULE_DIR=@BUILD_ROOT@ \
PIPEWIRE_CONFIG_FILE=build/src/daemon/pipewire.conf \ PIPEWIRE_CONFIG_FILE=@BUILD_ROOT@/src/daemon/pipewire.conf \
$(DBG) ./build/src/daemon/pipewire $(DBG) ./@BUILD_ROOT@/src/daemon/pipewire
gdb: gdb:
$(MAKE) run DBG=gdb $(MAKE) run DBG=gdb
@ -23,23 +23,23 @@ valgrind:
$(MAKE) run DBG="DISABLE_RTKIT=1 valgrind" $(MAKE) run DBG="DISABLE_RTKIT=1 valgrind"
test: all test: all
ninja -C build test ninja -C @BUILD_ROOT@ test
benchmark: all benchmark: all
ninja -C build benchmark ninja -C @BUILD_ROOT@ benchmark
monitor: all monitor: all
SPA_PLUGIN_DIR=build/spa/plugins \ SPA_PLUGIN_DIR=@BUILD_ROOT@/spa/plugins \
PIPEWIRE_MODULE_DIR=build/src/modules/ \ PIPEWIRE_MODULE_DIR=@BUILD_ROOT@/src/modules/ \
build/src/tools/pipewire-monitor @BUILD_ROOT@/src/tools/pipewire-monitor
cli: all cli: all
SPA_PLUGIN_DIR=build/spa/plugins \ SPA_PLUGIN_DIR=@BUILD_ROOT@/spa/plugins \
PIPEWIRE_MODULE_DIR=build/src/modules/ \ PIPEWIRE_MODULE_DIR=@BUILD_ROOT@/src/modules/ \
build/src/tools/pipewire-cli @BUILD_ROOT@/src/tools/pipewire-cli
shell: all shell: all
ninja -C build uninstalled ninja -C @BUILD_ROOT@ uninstalled
dist: all dist: all
git archive --prefix=pipewire-@VERSION@/ -o pipewire-@VERSION@.tar.gz @TAG@ git archive --prefix=pipewire-@VERSION@/ -o pipewire-@VERSION@.tar.gz @TAG@
@ -51,8 +51,8 @@ publish: all
git branch -D gh-pages 2>/dev/null || true && \ git branch -D gh-pages 2>/dev/null || true && \
git branch -D draft 2>/dev/null || true && \ git branch -D draft 2>/dev/null || true && \
git checkout -b draft && \ git checkout -b draft && \
git add -f build/doc/html && \ git add -f @BUILD_ROOT@/doc/html && \
git commit -anm "Deploy on gh-pages" && \ git commit -anm "Deploy on gh-pages" && \
git subtree split --prefix build/doc/html -b gh-pages && \ git subtree split --prefix @BUILD_ROOT@/doc/html -b gh-pages && \
git push --force origin gh-pages:gh-pages && \ git push --force origin gh-pages:gh-pages && \
git checkout work 2>/dev/null git checkout work 2>/dev/null

View file

@ -173,6 +173,7 @@ configinc = include_directories('.')
pipewire_inc = include_directories('src') pipewire_inc = include_directories('src')
makedata = configuration_data() makedata = configuration_data()
makedata.set('BUILD_ROOT', meson.build_root())
makedata.set('VERSION', pipewire_version) makedata.set('VERSION', pipewire_version)
if version_arr.length() == 4 if version_arr.length() == 4
makedata.set('TAG', 'HEAD') makedata.set('TAG', 'HEAD')