Skip to content

Commit 18282d7

Browse files
committed
factor out useful environment variables into environment.linux.makefile - update kernel makefiles to use this so we always have the correct path to the cache folder ($CACHE_DIR)
1 parent 6adaed9 commit 18282d7

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

engine/Makefile.kernel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ linuxstubs.cpp: src/linux.stubs
5151
include/revbuild.h: include/revbuild.h.in ../version
5252
../prebuilt/bin/Revolution.lnx "./encode_version.rev" "./"
5353

54-
../_cache/linux/$(MODE)/$(NAME)/mcstring.o: include/revbuild.h
54+
include ../rules/environment.linux.makefile
55+
56+
$(CACHE_DIR)/mcstring.o: include/revbuild.h
5557

5658
include Makefile.kernel-common

engine/Makefile.kernel-server

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ linuxstubs.cpp: src/linux.stubs
6161
encodederrors.cpp: src/executionerrors.h src/parseerrors.h
6262
../prebuilt/bin/Revolution.lnx "./encode_errors.rev" "./src" "./src/encodederrors.cpp"
6363

64-
../_cache/linux/$(MODE)/$(NAME)/mcstring.o: include/revbuild.h
64+
include ../rules/environment.linux.makefile
65+
66+
$(CACHE_DIR)/mcstring.o: include/revbuild.h
6567

6668
include ../rules/archive.linux.makefile

rules/common.linux.makefile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
# Common template Makefile for all types
22

3-
ifeq ($(MODE),)
4-
MODE=debug
5-
endif
6-
7-
ifeq ($(EDITION),)
8-
SOLUTION_DIR=$(shell cat ../owner)/..
9-
else
10-
SOLUTION_DIR=../livecode
11-
endif
12-
13-
BUILD_DIR=$(SOLUTION_DIR)/_build/linux/$(MODE)
14-
CACHE_DIR=$(SOLUTION_DIR)/_cache/linux/$(MODE)/$(NAME)
15-
PRODUCT_DIR=$(BUILD_DIR)
3+
include $(dir $(lastword $(MAKEFILE_LIST)))/environment.linux.makefile
164

175
DEFINES=$(CUSTOM_DEFINES) $(TYPE_DEFINES) _LINUX TARGET_PLATFORM_POSIX
186

rules/environment.linux.makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Common environment variables
2+
3+
ifeq ($(MODE),)
4+
MODE=debug
5+
endif
6+
7+
ifeq ($(EDITION),)
8+
SOLUTION_DIR=$(shell cat ../owner)/..
9+
else
10+
SOLUTION_DIR=../livecode
11+
endif
12+
13+
BUILD_DIR=$(SOLUTION_DIR)/_build/linux/$(MODE)
14+
CACHE_DIR=$(SOLUTION_DIR)/_cache/linux/$(MODE)/$(NAME)
15+
PRODUCT_DIR=$(BUILD_DIR)

0 commit comments

Comments
 (0)