aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-02 13:17:25 +0200
committerMattias Andrée <maandree@kth.se>2021-04-02 13:21:07 +0200
commit8b52cc7243c2e0e4ef17db5583999030b8636584 (patch)
tree29d4985285ecbbce2c7ec1cf61837ede3fccf526 /Makefile
downloadlibcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.gz
libcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.bz2
libcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile56
1 files changed, 56 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..33521e9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,56 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+
+OBJ =\
+ libcontacts_address_destroy.o\
+ libcontacts_birthday_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