-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (27 loc) · 898 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (27 loc) · 898 Bytes
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
CFLAGS=-ferror-limit=1 -std=c99 -Wpedantic -Wall -Wextra -Wno-string-plus-int #-fsanitize=address,undefined,bounds -g3 -Og
#CFLAGS=-std=c99 -Wpedantic -Wall -Wextra -g3 -Og
#CFLAGS=-std=c99 -Wpedantic -Wall -Wextra -Wno-string-plus-int -O3 -flto -march=native
OBJECT=rax.o
all:token
token:token.c rax.o
token.rl:element.rl
token.c:token.rl element.h
element.h:element.m4
m4 -D variant=c $< > $@
element.rl:element.m4
m4 -D variant=ragel $< | sed "s/@aq@/'/g" > $@
# @aq@ is a quadrigraph. In groff, \(aq inserts a neutral apostrophe
RAW_RAX=https://raw.githubusercontent.com/antirez/rax/1927550cb218ec3c3dda8b39d82d1d019bf0476d
rax.h:
curl $(RAW_RAX)/$@ > $@
rax.c:
curl $(RAW_RAX)/$@ > $@
rax_malloc.h:
curl $(RAW_RAX)/$@ > $@
rax.o:rax.c rax.h rax_malloc.h
$(CC) $(CFLAGS) -c $<
clean:
rm -f token token.c element.h element.rl $(OBJECT)
.SUFFIXES:.c .rl
.rl.c:
ragel -G2 $<