-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
61 lines (45 loc) · 2.01 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.PHONY : help build strip clean testjson testplain
VERSION="\"0.3\""
CFLAGS+=-D_GNU_SOURCE -std=c99 -Wall -Wextra -Werror -pipe
CFLAGS+=-Wno-unused-function
CFLAGS+=-ljansson
CFLAGS+=-O2 -DFLEECE_VERSION=$(VERSION)
CFLAGS_DEBUG+=-g -DDEBUG
LIBS=
MAKE?=make
CC=gcc
default: build
help:
@echo "----------------------------------------------------------------------"
@echo "This Makefile handles the following targets:"
@echo " build - builds fleece"
@echo "build_debug - builds fleece with debug cflags"
@echo " strip - strips the fleece binary"
@echo " clean - cleans what has to be"
@echo " testjson - runs a test with a json file on localhost port 12345 udp"
@echo " testncsa - runs a test with a json to ncsa on localhost syslog"
@echo " testboth - runs a both previous tests on localhoast port 12345"
@echo " testj2n - runs a test with a bad json to ncsa"
@echo " json2ncsa - build a standalone version of json to ncsa like"
@echo "----------------------------------------------------------------------"
@echo "for tests : tcpdump -Xvelni lo port 12345"
@echo "and (or) : nc -u -l -s 127.0.0.1 -p 12345"
build: clean
$(CC) $(CFLAGS) -o fleece src/fleece.c src/hostnameip.c src/json2ncsa.c
build_debug: clean
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o fleece src/fleece.c src/hostnameip.c src/json2ncsa.c
strip:
strip -X fleece
strip -s fleece
clean:
rm -f fleece
testjson: fleece
cat json.log.clean | ./fleece --host 127.0.0.1 --port 12345 --field pouet=lala --field tutu=tata
testncsa: fleece
cat json.log.clean | ./fleece --syslog-host 127.0.0.1 --syslog-port 12345 --field pouet=lala --field tutu=tata
testboth: fleece
cat json.log.clean | ./fleece --host 127.0.0.1 --port 12345 --syslog-host 127.0.0.1 --syslog-port 12345 --field pouet=lala --field tutu=tata
testj2n: fleece
cat json.log.bad | ./fleece --host 127.0.0.1 --port 12345 --syslog-host 127.0.0.1 --syslog-port 12345 --field pouet=lala --field tutu=tata
json2ncsa: clean
$(CC) $(CFLAGS) -DSTANDALONE -o json2ncsa src/json2ncsa.c