]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | # |
11fdf7f2 | 2 | # Copyright (c) 2015-2017 the Civetweb developers |
7c673cae FG |
3 | # |
4 | # License http://opensource.org/licenses/mit-license.php MIT License | |
5 | # | |
6 | ||
7 | ifndef WITH_DUKTAPE | |
8 | $(error WITH_DUKTAPE is not defined) | |
9 | endif | |
10 | ||
11fdf7f2 TL |
11 | # Duktape default version is 1.5.2 (105) |
12 | WITH_DUKTAPE_VERSION ?= 105 | |
7c673cae FG |
13 | DUKTAPE_VERSION_KNOWN = 0 |
14 | ||
15 | # Select src and header according to the Duktape version | |
11fdf7f2 TL |
16 | ifeq ($(WITH_DUKTAPE_VERSION), 105) |
17 | $(info Duktape: Using version 1.5.2) | |
18 | DUKTAPE_DIR = src/third_party/duktape-1.5.2/src | |
19 | DUKTAPE_SHARED_LIB_FLAG = -lduktape1.5 | |
20 | DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=105 | |
21 | DUKTAPE_VERSION_KNOWN = 1 | |
22 | endif | |
23 | ||
24 | ifeq ($(WITH_DUKTAPE_VERSION), 108) | |
25 | $(info Duktape: Using version 1.8.0) | |
26 | DUKTAPE_DIR = src/third_party/duktape-1.8.0/src | |
27 | DUKTAPE_SHARED_LIB_FLAG = -lduktape1.8 | |
28 | DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=108 | |
29 | DUKTAPE_VERSION_KNOWN = 1 | |
30 | endif | |
31 | ||
32 | ifeq ($(WITH_DUKTAPE_VERSION), 201) | |
33 | $(info Duktape: Using version 2.1.1) | |
34 | DUKTAPE_DIR = src/third_party/duktape-2.1.1/src | |
35 | DUKTAPE_SHARED_LIB_FLAG = -lduktape2.1 | |
36 | DUKTAPE_CFLAGS = -DDUKTAPE_VERSION_MAKEFILE=201 | |
7c673cae FG |
37 | DUKTAPE_VERSION_KNOWN = 1 |
38 | endif | |
39 | ||
40 | ifneq ($(DUKTAPE_VERSION_KNOWN), 1) | |
41 | $(error Duktape: Unknwon version - $(WITH_DUKTAPE_VERSION)) | |
42 | endif | |
43 | ||
44 | ||
45 | # Add flags for all Duktape versions | |
46 | DUKTAPE_CFLAGS += -I$(DUKTAPE_DIR) -DUSE_DUKTAPE | |
47 | ||
48 | ifneq ($(TARGET_OS),WIN32) | |
49 | # DUKTAPE_CFLAGS += | |
50 | endif | |
51 | ||
52 | ifdef WITH_DUKTAPE_SHARED | |
53 | ||
54 | DUKTAPE_SOURCE_FILES = | |
55 | ||
56 | $(info Duktape: using dynamic linking) | |
57 | ||
58 | else | |
59 | ||
60 | DUKTAPE_SOURCE_FILES = duktape.c | |
61 | ||
62 | ifeq ($(WITH_DUKTAPE_VERSION), 104) | |
11fdf7f2 | 63 | # DUKTAPE_SOURCE_FILES += ... TODO ... |
7c673cae FG |
64 | endif |
65 | ||
66 | $(info Duktape: using static library) | |
67 | ||
68 | endif | |
69 | ||
70 | DUKTAPE_SOURCES = $(addprefix $(DUKTAPE_DIR)/, $(DUKTAPE_SOURCE_FILES)) | |
71 | DUKTAPE_OBJECTS = $(DUKTAPE_SOURCES:.c=.o) | |
72 | ||
73 | OBJECTS += $(DUKTAPE_OBJECTS) | |
74 | CFLAGS += $(DUKTAPE_CFLAGS) | |
75 | SOURCE_DIRS = $(DUKTAPE_DIR) | |
11fdf7f2 | 76 | BUILD_DIRS += $(BUILD_DIR)/$(DUKTAPE_DIR) |
7c673cae | 77 |