-
Notifications
You must be signed in to change notification settings - Fork 964
/
Makefile.in-duktape
85 lines (64 loc) · 2.06 KB
/
Makefile.in-duktape
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# Copyright (c) 2015-2017 the Civetweb developers
#
# License http://opensource.org/licenses/mit-license.php MIT License
#
ifndef WITH_DUKTAPE
$(error WITH_DUKTAPE is not defined)
endif
# Duktape default version is 1.8.0 (108)
WITH_DUKTAPE_VERSION ?= 108
DUKTAPE_VERSION_KNOWN = 0
# Select src and header according to the Duktape version
ifeq ($(WITH_DUKTAPE_VERSION), 105)
$(info Duktape: Using version 1.5.2)
DUKTAPE_DIR = src/third_party/duktape-1.5.2/src
DUKTAPE_SHARED_LIB_FLAG = -lduktape1.5
DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=105
DUKTAPE_VERSION_KNOWN = 1
endif
ifeq ($(WITH_DUKTAPE_VERSION), 108)
$(info Duktape: Using version 1.8.0)
DUKTAPE_DIR = src/third_party/duktape-1.8.0/src
DUKTAPE_SHARED_LIB_FLAG = -lduktape1.8
DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=108
DUKTAPE_VERSION_KNOWN = 1
endif
ifeq ($(WITH_DUKTAPE_VERSION), 201)
$(info Duktape: Using version 2.1.1)
DUKTAPE_DIR = src/third_party/duktape-2.1.1/src
DUKTAPE_SHARED_LIB_FLAG = -lduktape2.1
DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=201
DUKTAPE_VERSION_KNOWN = 1
endif
ifeq ($(WITH_DUKTAPE_VERSION), 202)
$(info Duktape: Using version 2.2.0)
DUKTAPE_DIR = src/third_party/duktape-2.2.0/src
DUKTAPE_SHARED_LIB_FLAG = -lduktape2.2
DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=202
DUKTAPE_VERSION_KNOWN = 1
endif
ifneq ($(DUKTAPE_VERSION_KNOWN), 1)
$(error Duktape: Unknown version - $(WITH_DUKTAPE_VERSION))
endif
# Add flags for all Duktape versions
DUKTAPE_CFLAGS = -I$(DUKTAPE_DIR) -DUSE_DUKTAPE
ifneq ($(TARGET_OS),WIN32)
# DUKTAPE_CFLAGS =
endif
ifdef WITH_DUKTAPE_SHARED
DUKTAPE_SOURCE_FILES =
$(info Duktape: using dynamic linking)
else
DUKTAPE_SOURCE_FILES = duktape.c
ifeq ($(WITH_DUKTAPE_VERSION), 104)
# DUKTAPE_SOURCE_FILES = ... TODO ...
endif
$(info Duktape: using static library)
endif
DUKTAPE_SOURCES = $(addprefix $(DUKTAPE_DIR)/, $(DUKTAPE_SOURCE_FILES))
DUKTAPE_OBJECTS = $(DUKTAPE_SOURCES:.c=.o)
OBJECTS = $(DUKTAPE_OBJECTS)
CFLAGS = $(DUKTAPE_CFLAGS)
SOURCE_DIRS = $(DUKTAPE_DIR)
BUILD_DIRS = $(BUILD_DIR)/$(DUKTAPE_DIR)