forked from intel/zephyr.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.linux
46 lines (34 loc) · 1017 Bytes
/
Makefile.linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ifndef ZJS_BASE
$(error ZJS_BASE not defined)
endif
JERRY_BASE ?= $(ZJS_BASE)/deps/jerryscript
.PHONY: all
all: linux
CORE_SRC = src/main.c \
src/zjs_buffer.c \
src/zjs_callbacks.c \
src/zjs_event.c \
src/zjs_linux_time.c \
src/zjs_modules.c \
src/zjs_script.c \
src/zjs_script_gen.c \
src/zjs_timers.c \
src/zjs_util.c
CORE_OBJ = $(CORE_SRC:%.c=%.o)
LINUX_INCLUDES = -Isrc/ \
-I$(JERRY_BASE)/jerry-core
JERRY_LIBS = -ljerry-core -lm
JERRY_LIB_PATH = -L$(JERRY_BASE)/build/lib/
LINUX_FLAGS = -std=gnu99 -Wpointer-sign
LINUX_DEFINES = -DZJS_LINUX_BUILD -DBUILD_MODULE_EVENTS
ifeq ($(VARIANT), debug)
LINUX_DEFINES += -DDEBUG_BUILD
endif
%.o:%.c
@echo "Building $@"
gcc -c -o $@ $< $(LINUX_INCLUDES) $(LINUX_DEFINES) $(LINUX_FLAGS)
.PHONY: linux
linux: $(CORE_OBJ)
@echo "Building for Linux $(CORE_OBJ)"
cd deps/jerryscript; python ./tools/build.py;
gcc -o jslinux -flto $(CORE_OBJ) $(JERRY_LIB_PATH) $(JERRY_LIBS) $(LINUX_INCLUDES) $(LINUX_DEFINES) $(LINUX_FLAGS)