aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.common
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-01-03 12:45:37 +0000
committerRichard van der Hoff <richard@matrix.org>2016-01-03 12:45:37 +0000
commit9ac2c979fb25e57c2a8aab81de7fe0d427a437dc (patch)
tree16a154eb8f0786d7116bbf2f0cb0090da38fcc84 /Makefile.common
parent277ce56307aad8b5627baaf1766c9d931bf7560e (diff)
downloadpurple-matrix-9ac2c979fb25e57c2a8aab81de7fe0d427a437dc.tar.gz
Factor out common parts of Makefile and Makefile.mingw
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile.common b/Makefile.common
new file mode 100644
index 0000000..05dc040
--- /dev/null
+++ b/Makefile.common
@@ -0,0 +1,41 @@
+# common parts of Makefile and Makefile.mingw
+
+COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
+
+CFLAGS+=-Wall -g -O0 -Werror
+CFLAGS += -DPURPLE_PLUGINS
+
+# generate .d files when compiling
+CPPFLAGS += -MMD
+
+OBJECTS = libmatrix.o matrix-api.o matrix-connection.o \
+ matrix-event.o \
+ matrix-json.o \
+ matrix-room.o \
+ matrix-roommembers.o \
+ matrix-statetable.o \
+ matrix-sync.o
+
+all: $(TARGET)
+clean:
+ rm -f $(OBJECTS) $(OBJECTS:.o=.d) $(TARGET)
+
+install:
+ mkdir -p $(DESTDIR)$(PLUGIN_DIR_PURPLE)
+ install -m 664 $(TARGET) $(DESTDIR)$(PLUGIN_DIR_PURPLE)
+ for i in 16 22 48; do \
+ mkdir -p $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/$$i; \
+ install -m 664 matrix-$${i}px.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/$$i/matrix.png; \
+ done
+
+$(TARGET): $(OBJECTS)
+ $(LINK.o) -shared $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+%.o: %.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+-include $(OBJECTS:.o=.d)
+
+# Local Variables:
+# mode: makefile
+# End: