summaryrefslogtreecommitdiff
path: root/Makefile
blob: 752cc2c3a629d81f65c380cb2d7965330c68b2f5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROJECT=agni
CC=gcc
CFLAGS=

make: version
	$(CC) $(CFLAGS) buf.c -c
	$(CC) $(CFLAGS) mmm.c -c
	$(CC) $(CFLAGS) darray.c -c
	$(CC) $(CFLAGS) mq_cmd.c -c
	$(CC) $(CFLAGS) mq_ntf.c -c
	$(CC) $(CFLAGS) tbl_qcmd.c -c
	$(CC) $(CFLAGS) util.c -c
	$(CC) $(CFLAGS) sock_conn.c -c
	$(CC) $(CFLAGS) irc_parse.c -c
	$(CC) $(CFLAGS) mmm.c -c 
	$(CC) $(CFLAGS) cmd_date.c -c
	$(CC) $(CFLAGS) cmd_uptime.c -c
	$(CC) $(CFLAGS) cmd_version.c -c
	$(CC) $(CFLAGS) cmd_ping.c -c
	$(CC) $(CFLAGS) cmd_loadavg.c -c
	$(CC) $(CFLAGS) cmd_rusage.c -c
	$(CC) $(CFLAGS) cmd_cmd.c -c
	$(CC) $(CFLAGS) sha1.c -c
	$(CC) $(CFLAGS) cmd_sha1.c -c
	$(CC) $(CFLAGS) cmd_cookie.c -c
	$(CC) $(CFLAGS) cmd_botu.c -c
	$(CC) $(CFLAGS) cmd_fir1p.c -c
	$(CC) $(CFLAGS) sds.c -c
	$(CC) $(CFLAGS) tbl_qcmd.o mq_cmd.o mq_ntf.o buf.o mmm.o darray.o util.o sock_conn.o \
	irc_parse.o mmm.c cmd_date.o cmd_uptime.o cmd_version.o cmd_ping.o cmd_loadavg.o \
	cmd_rusage.c cmd_cmd.o sha1.o cmd_sha1.o cmd_cookie.o cmd_botu.o cmd_fir1p.o sds.o \
	agni.c \
	-o $(PROJECT) -std=c11 -lrt

version:
	#could have bug if commit message have somethign bad in it
	rm -f version.h
	echo "#ifndef __VERSION_H">>version.h
	echo "#define __VERSION_H">>version.h
	echo "#define VERSION_DATE \""`date`"\"">>version.h
	echo "#define VERSION_COMMIT \""`git log -1 --oneline`"\"">>version.h
	echo "#endif">>version.h

leak:
	valgrind --leak-check=full --track-origins=yes --log-file=log.txt ./$(PROJECT)

clean:
	rm -f agni *.o