Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 433acba

Browse files
committed
[[ Build ]] Linux: Add libstdscript to build.
1 parent c11e12e commit 433acba

File tree

6 files changed

+117
-34
lines changed

6 files changed

+117
-34
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,8 @@ prebuilt/lib
9898
prebuilt/build
9999
prebuilt/packaged
100100
prebuilt/fetched
101+
102+
# Stamp files and generated C files
103+
###################################
104+
stamp-mlc*
105+
_mlc

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ revandroid: libexternalv1
185185
# MLC Targets
186186

187187
.PHONY: lc-compile lc-bootstrap-compile lc-compile-clean
188+
.PHONY: libstdscript
189+
190+
########## Standard script library
191+
libstdscript: lc-compile
192+
$(MAKE) -C ./libscript libstdscript
188193

189194
########## Compiler
190195
lc-compile: libscript libfoundation
@@ -209,9 +214,11 @@ all: server-revdb server-dbodbc server-dbsqlite server-dbmysql server-dbpostgres
209214
all: development standalone installer server
210215
all: revpdfprinter revandroid
211216
all: lc-bootstrap-compile
217+
all: lc-test
212218

213219
bootstrap: lc-bootstrap-compile
214220

215221
clean:
216222
@rm -r _build/linux _cache/linux
223+
-rm -rf `find . -type d -name _mlc`
217224
clean: lc-compile-clean

libscript/Makefile

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
1-
NAME=libscript
2-
TYPE=archive
1+
all: libscript libstdscript
2+
clean: libstdscript-clean
33

4-
include ../rules/environment.linux.makefile
4+
libscript:
5+
$(MAKE) -f Makefile.libscript libscript
56

6-
SOURCES=\
7-
module-arithmetic.cpp \
8-
module-array.cpp \
9-
module-binary.cpp \
10-
module-bitwise.cpp \
11-
module-byte.cpp \
12-
module-char.cpp \
13-
module-encoding.cpp \
14-
module-file.cpp \
15-
module-list.cpp \
16-
module-logic.cpp \
17-
module-map.cpp \
18-
module-math.cpp \
19-
module-math_foundation.cpp \
20-
module-sort.cpp \
21-
module-string.cpp \
22-
module-type_convert.cpp \
23-
module-type.cpp \
24-
module-url.cpp \
25-
script-builder.cpp \
26-
script-instance.cpp \
27-
script-module.cpp \
28-
script-object.cpp \
29-
script-package.cpp
7+
libstdscript:
8+
$(MAKE) -f Makefile.libstdscript libstdscript
309

31-
CUSTOM_DEFINES=TARGET_PLATFORM_LINUX
32-
33-
CUSTOM_INCLUDES=./src ../engine/src
34-
35-
CUSTOM_CCFLAGS=-fno-exceptions -fno-rtti
36-
37-
include ../rules/archive.linux.makefile
10+
.PHONY: all clean
11+
.PHONY: libscript
12+
.PHONY: libstdscript libstdscript-clean

libscript/Makefile.libscript

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*-Makefile-*-
2+
3+
NAME ?= libscript
4+
TYPE = archive
5+
6+
include ../rules/environment.linux.makefile
7+
8+
SOURCES += \
9+
module-arithmetic.cpp \
10+
module-array.cpp \
11+
module-binary.cpp \
12+
module-bitwise.cpp \
13+
module-byte.cpp \
14+
module-char.cpp \
15+
module-encoding.cpp \
16+
module-file.cpp \
17+
module-list.cpp \
18+
module-logic.cpp \
19+
module-map.cpp \
20+
module-math.cpp \
21+
module-math_foundation.cpp \
22+
module-sort.cpp \
23+
module-string.cpp \
24+
module-type_convert.cpp \
25+
module-type.cpp \
26+
module-url.cpp \
27+
script-builder.cpp \
28+
script-instance.cpp \
29+
script-module.cpp \
30+
script-object.cpp \
31+
script-package.cpp
32+
33+
CUSTOM_DEFINES=TARGET_PLATFORM_LINUX
34+
35+
CUSTOM_INCLUDES=./src ../engine/src
36+
37+
CUSTOM_CCFLAGS=-fno-exceptions -fno-rtti
38+
39+
include ../rules/archive.linux.makefile

libscript/Makefile.libstdscript

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*-Makefile-*-
2+
3+
NAME ?= libstdscript
4+
5+
# Add source code derived from MLC to list of source files
6+
SOURCES += $(MLC_BUILT_SOURCES)
7+
8+
include ../rules/environment.linux.makefile
9+
10+
include ../rules/mlc.linux.makefile
11+
12+
# Inherit almost all settings from libscript
13+
include Makefile.libscript

rules/mlc.linux.makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*-Makefile-*-
2+
3+
################################################################
4+
# MLC
5+
#
6+
7+
# Should have been set to a file containing a list of MLC files to build
8+
MLC_LIST ?= $(NAME)-modules.list
9+
10+
SRC_DIR ?= ./src
11+
MLC_SRC_DIR = $(SRC_DIR)/_mlc
12+
13+
LC_COMPILE ?= $(shell PATH=$(BUILD_DIR):$(PATH) \
14+
which lc-compile 2>/dev/null || \
15+
echo "lc-compile" )
16+
17+
MLC_SOURCES = $(shell cat $(MLC_LIST) | grep -v '^\#')
18+
19+
MLC_BUILT_SOURCES = $(patsubst %.mlc,_mlc/%.c,$(MLC_SOURCES))
20+
21+
MLC_STAMP ?= $(MLC_SRC_DIR)/stamp-mlc-$(NAME)
22+
23+
$(MLC_STAMP): $(MLC_SOURCES) $(MLC_LIST) $(LC_COMPILE)
24+
mkdir -p $(MODULE_DIR) $(MLC_SRC_DIR)
25+
@for f in $(MLC_SOURCES); do \
26+
mlcfile=$(SRC_DIR)/$$f ; \
27+
cfile=$(MLC_SRC_DIR)/`echo $$f | sed -e's:mlc$$:c:'` ; \
28+
$(LC_COMPILE) -modulepath $(MODULE_DIR) -outputc $$cfile $$mlcfile \
29+
|| exit $$? ; \
30+
done
31+
touch $@
32+
33+
$(MLC_BUILT_SOURCES): $(MLC_STAMP)
34+
35+
# Add MLC-derived files to list of source files to compile
36+
SOURCES += $(MLC_BUILT_SOURCES)
37+
38+
clean: mlc-clean
39+
mlc-clean:
40+
-rm -rf $(MLC_SRC_DIR)
41+
42+
.PHONY: mlc-clean
43+
44+
################################################################

0 commit comments

Comments
 (0)