-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 865 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 865 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
LUVIT = luvit
CFLAGS = $(shell $(LUVIT) --cflags | sed s/-Werror//)
LIBS = $(shell $(LUVIT) --libs)
HIREDISDIR = deps/hiredis
# uncomment to use freelist for references (saves malloc/free calls)
#CFLAGS += -DUSE_REF_FREELIST=1
all: build/redis.luvit
${HIREDISDIR}/Makefile:
git submodule update --init ${HIREDISDIR}
${HIREDISDIR}/libhiredis.a: ${HIREDISDIR}/Makefile
$(MAKE) -C ${HIREDISDIR} libhiredis.a
build/%.luvit: src/%.c ${HIREDISDIR}/libhiredis.a
mkdir -p build
$(CC) ${CFLAGS} -I${HIREDISDIR} -Isrc -o $@ $^ ${LIBS} ${HIREDISDIR}/libhiredis.a
clean:
${MAKE} -C ${HIREDISDIR} clean
rm -fr build
profile:
valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes luvit benchmark.lua
profile-mem:
valgrind --leak-check=full --show-reachable=yes -v luvit benchmark.lua
.PHONY: all clean deps profile profile-mem