aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8d845fef39edeb6e987be4701b08c076dc573577 (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
49
50
51
52
53
54
55
56
57
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)


OBJ =\
	libcontacts_address_destroy.o\
	libcontacts_birthday_destroy.o\
	libcontacts_block_destroy.o\
	libcontacts_chat_destroy.o\
	libcontacts_contact_destroy.o\
	libcontacts_email_destroy.o\
	libcontacts_format_contact.o\
	libcontacts_get_path.o\
	libcontacts_list_contacts.o\
	libcontacts_load_contact.o\
	libcontacts_load_contacts.o\
	libcontacts_number_destroy.o\
	libcontacts_organisation_destroy.o\
	libcontacts_parse_contact.o\
	libcontacts_pgpkey_destroy.o\
	libcontacts_save_contact.o\
	libcontacts_site_destroy.o

HDR =\
	common.h\
	libcontacts.h


all: libcontacts.a
$(OBJ): $($@:.o=.c) $(HDR)

libcontacts.a: $(OBJ)
	$(AR) rc $@ $(OBJ)
	$(AR) -s $@

.c.o:
	$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)

install: libcontacts.a
	mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
	mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
	cp -- libcontacts.a "$(DESTDIR)$(PREFIX)/lib/"
	cp -- libcontacts.h "$(DESTDIR)$(PREFIX)/include/"

uninstall:
	-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libcontacts.a"
	-rm -f -- "$(DESTDIR)$(PREFIX)/include/libcontacts.h"

clean:
	-rm -f -- *.o *.a *.lo *.so *.su

.SUFFIXES:
.SUFFIXES: .c .o

.PHONY: all install uninstall clean