summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a5f5a31f35ff684a95d22c1147f833214852db16 (plain) (blame)
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
DESTDIR=/

default:
	mkdir tmp -p
	xxd -i < src/hp.html > tmp/hp.xxd
	echo ', 0' >> tmp/hp.xxd
	gcc -Wall -pedantic -g -Isrc -Itmp -pthread src/main.c $$(xml2-config --libs --cflags) -lmicrohttpd -osear.c

install:
	mkdir -p $(DESTDIR)/usr/bin/
	cp sear.c $(DESTDIR)/usr/bin/

distclean:
	rm sear.c tmp -rf

clean:
	rm sear.c tmp -rf

prepare:
	sudo apt install libmicrohttpd-dev xxd build-essential libxml2-dev -y

test-http:
	mkdir -p tmp
	gcc -Wall -pedantic -g -Isrc -Itmp test/nanohttp.c $$(xml2-config --libs --cflags) -otmp/nanohttp

test-http-valgrind:
	valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt tmp/nanohttp http://sijanec.eu/