forked from drax-lang/drax
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
136 lines (113 loc) · 2.03 KB
/
Copy pathMakefile
File metadata and controls
136 lines (113 loc) · 2.03 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
CC=gcc
APP=drax
## Asm
ASM_LINKS=
FILES= ./src/dvm.c \
./src/dtypes.c \
./src/dparser.c \
./src/dshell.c \
./src/dflags.c \
./src/dio.c \
./src/dlex.c \
./src/drax.c \
./src/dhandler.c \
./src/dstructs.c \
./src/dbuiltin.c \
./src/dtime.c \
./src/dstring.c \
./src/dgc.c \
./src/deval.c \
./src/dscheduler.c \
./src/doutopcode.c \
./src/mods/d_mod_os.c \
./src/mods/d_mod_http.c \
./src/mods/d_mod_tensor.c \
./src/mods/d_mod_list.c
DEBUGF= -ggdb \
-g
OUTDIR=./bin/
OUTBIN= -o $(OUTDIR)$(APP)
ifeq ($(TARGET_OS),)
ifeq ($(OS),Windows_NT)
TARGET_OS = WIN32
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
TARGET_OS = LINUX
else
ifeq ($(UNAME_S),Darwin)
TARGET_OS = OSX
else
TARGET_OS = BSD
endif
endif
endif
endif
ifeq ($(TARGET_OS),LINUX)
LIBS += -ldl -lrt
endif
ifdef WITH_ZLIB
LIBS += -lz
endif
WARNING= \
-Wextra \
-Wundef \
-Wshadow \
-Wfatal-errors \
-Wsign-compare \
-Wwrite-strings \
-Wredundant-decls \
-Wdouble-promotion \
-Wmissing-declarations \
-Wdisabled-optimization \
FLAGS= -std=c99 \
-lm \
-Wall \
-ansi \
$(WARNING) \
$(DWN_CCFLAGS) \
$(LIBS) \
$(HTTP_LIB_FLAGS) \
$(OUTBIN)
ifdef NO_SSL
FLAGS += -DNO_SSL
endif
ifeq ($(LIGHT), 1)
DRAX_BUILD_FULL=
else
DRAX_BUILD_FULL= \
-D_B_BUILF_FULL \
-ledit
endif
ifeq ($(TARGET_OS),WIN32)
DRAX_BUILD_FULL=
FLAGS += -lws2_32
else
FLAGS += -pthread
endif
DEFAULT_BUILD = \
$(CC) \
$(FILES) \
$(ASM_LINKS) \
$(DRAX_BUILD_FULL) \
$(FLAGS)
all: $(HTTP_LIB_NAME)
$(DEFAULT_BUILD)
debug: $(HTTP_LIB_NAME)
$(DEFAULT_BUILD) $(DEBUGF)
inspect: $(HTTP_LIB_NAME)
$(DEFAULT_BUILD) $(DEBUGF) -D_AST_INSPECT
opcode: $(HTTP_LIB_NAME)
$(DEFAULT_BUILD) $(DEBUGF) -D_AST_INSPECT_OP
run:
./bin/$(APP)
config:
mkdir bin
test:
ifeq ($(TARGET_OS),WIN32)
tests\run-test.bat
else
sh tests/run-test.sh
endif
clean:
rm -rf ./bin/$(APP)