Skip to content
Snippets Groups Projects
Commit e54778d5 authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Pekka Enberg
Browse files

Makefile: use abolute paths in generated variables


This allows to use these variables inside build.mk regardless of CWD
and is more clear than a cascade of ".."s

This change also unifies $(submake) and $(modulemk) generation
to reduce duplication.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 3f494068
No related branches found
No related tags found
No related merge requests found
......@@ -25,21 +25,13 @@ all: $(submake) $(modulemk)
$(call only-if, $(mgmt), cd mgmt && ./gradlew --daemon :web:jar build)
$(MAKE) -r -C $(dir $(submake)) $@
$(submake): Makefile
$(submake) $(modulemk): Makefile
mkdir -p $(dir $@)
echo 'mode = $(mode)' > $@
echo 'src = ../..' >> $@
echo 'src = $(abspath .)' >> $@
echo 'out = $(abspath $(out))' >> $@
echo 'VPATH = ../..' >> $@
echo 'include ../../build.mk' >> $@
$(modulemk): Makefile
mkdir -p $(dir $@)
echo 'mode = $(mode)' > $@
echo 'src = ../../../..' >> $@
echo 'out = $(abspath $(out))' >> $@
echo 'VPATH = ../../../../' >> $@
echo 'include ../../../../build.mk' >> $@
echo 'VPATH = $(abspath .)' >> $@
echo 'include $(abspath build.mk)' >> $@
clean:
$(call quiet, rm -rf build/$(mode), CLEAN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment