forked from rlt3/Dialogue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 925 Bytes
/
Makefile
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
UNAME:=$(shell uname)
MODULE:=dialogue
CFLAGS+=-Wall -std=c99 -pedantic -D _BSD_SOURCE -fPIC -Isrc/ -I./
LDFLAGS+=-L./ -L/usr/local/lib -lpthread -lreadline
SOURCES:=src/main.o src/console.o\
src/dialogue.o \
src/company.o src/tree.o \
src/actor.o src/script.o \
src/director.o src/worker.o
ifeq ($(UNAME), Linux)
CFLAGS+=-I/usr/include/lua5.2/
LDFLAGS+=-llua5.2
endif
ifeq ($(UNAME), Darwin)
CFLAGS+=-I/usr/local/include/
LDFLAGS+=-llua
endif
all: clean build
check: clean build test
build: $(SOURCES)
$(CC) $(CFLAGS) $(SOFLAGS) -o $(MODULE) $^ $(LDFLAGS)
test:
cd spec/ && ../$(MODULE) -s company.lua
cd spec/ && ../$(MODULE) -s -l actor.lua
cd spec/ && ../$(MODULE) -s director.lua
mem:
valgrind --leak-check=full -v ./$(MODULE) -s spec/director.lua
hel:
valgrind --tool=helgrind -v ./$(MODULE) -s spec/director.lua
tags:
ctags -R -f tags .
clean:
rm -f $(MODULE) src/*o