forked from Gandi/fleece
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.33 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
.PHONY : help build strip clean testjson testplain
VERSION=0.1
CFLAGS+=-D_POSIX_C_SOURCE=199309 -std=c99 -Wall -Wextra -Werror -pipe
CFLAGS+=-g
CFLAGS+=-Wno-unused-function
CFLAGS+=-ljansson
LIBS=
MAKE?=make
CC=gcc
CFLAGS+=-Iinclude
LDFLAGS+=-Llib
default: build
help:
@echo "----------------------------------------------------------------------"
@echo "This Makefile handles the following targets:"
@echo " build - builds fleece"
@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 " testplain - runs a test with a string on localhost port 12345 udp"
@echo "----------------------------------------------------------------------"
@echo "for tests : tcpdump -Xvelni lo port 12345"
build: clean
$(CC) $(CFLAGS) -o fleece src/fleece.c src/str.c src/hostnameip.c
clean:
rm -f fleece
testjson:
@if [ -f fleece ]; \
then \
cat json.log.clean | ./fleece --host 127.0.0.1 --port 12345 --field pouet=lala --field tutu=tata \
else \
@echo "fleece binary was not found. Did you build it ?";\
fi
testplain:
@if [ -f fleece ]; \
then \
echo "pouetpouet" | ./fleece --host 127.0.0.1 --port 12345 --field pouet=lala --field tutu=tata \
else \
@echo "fleece binary was not found. Did you build it ?";\
fi