about summary refs log tree commit diff stats
path: root/Makefile
blob: be25a2aa49c84fd0d722e7f62bcc8e9057bb27b9 (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
CC = gcc
WARNS = -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-but-set-variable \
	-Wno-unused-result
LIBS = -lxml2 -lexpat -lssl -lresolv -lncurses -L ~/lib -lstrophe `pkg-config --libs glib-2.0`
TESTLIB = -L ~/lib -l headunit
CPPLIB = -lstdc++
CFLAGS = -I ~/include -O3 $(WARNS) $(LIBS) `pkg-config --cflags glib-2.0`
OBJS = log.o windows.o title_bar.o status_bar.o input_win.o jabber.o \
       profanity.o util.o command.o history.o contact_list.o prof_history.o \
	   main.o
TESTOBJS = test_history.o history.o test_contact_list.o contact_list.o \
	       test_util.o test_prof_history.o prof_history.o util.o

profanity: $(OBJS)
	$(CC) -o profanity $(OBJS) $(LIBS)

log.o: log.h
windows.o: windows.h util.h contact_list.h
title_bar.o: windows.h
status_bar.o: windows.h util.h
input_win.o: windows.h
jabber.o: jabber.h log.h windows.h contact_list.h
profanity.o: log.h windows.h jabber.h command.h history.h
util.o: util.h
command.o: command.h util.h history.h contact_list.h
history.o: history.h
contact_list.o: contact_list.h
prof_history.o: prof_history.h
main.o: profanity.h

test_history.o: history.h
test_contact_list.o: contact_list.h
test_util.o: util.h
test_prof_history.o: prof_history.h

testsuite: testsuite.h $(TESTOBJS)
	$(CC) $(CFLAGS) $(CPPLIB) testsuite.c $(TESTOBJS) -o testsuite $(TESTLIB)

.PHONY: test
test: testsuite
	./testsuite

.PHONY: clean
clean:
	rm -f profanity
	rm -f profanity.log
	rm -f *.o
	rm -f testsuite