Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/pidgin-opensteamworks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2015-10-06 01:01:40 +0300
committerEion Robb <eion@robbmob.com>2015-10-06 01:01:40 +0300
commite2bc89c9f17ab4137d03ee482f011ece7f50d475 (patch)
treee6a3c4f6cb5c632497c050fe02caaf463ca950e3
parent5c881d52422407d0c2bb1586df73aeb486a307d2 (diff)
Add `make install` option to Makefile
Fixes issue #115
-rw-r--r--steam-mobile/Makefile44
1 files changed, 28 insertions, 16 deletions
diff --git a/steam-mobile/Makefile b/steam-mobile/Makefile
index fee9927..3f66ee1 100644
--- a/steam-mobile/Makefile
+++ b/steam-mobile/Makefile
@@ -1,23 +1,26 @@
-COMPILER = gcc
+CC ?= gcc
+CFLAGS ?= -O2 -g -pipe
PKG_CONFIG ?= pkg-config
-# Global libraries
-LIBPURPLE_CFLAGS += $(shell ${PKG_CONFIG} --cflags glib-2.0 json-glib-1.0 purple gnome-keyring-1)
-LIBPURPLE_LIBS += $(shell ${PKG_CONFIG} --libs glib-2.0 json-glib-1.0 purple)
+DIR_PERM = 0755
+FILE_PERM = 0644
-CFLAGS = ${LIBPURPLE_CFLAGS}
-LIBS = ${LIBPURPLE_LIBS}
+# Global libraries
+LIBPURPLE_CFLAGS += $(shell $(PKG_CONFIG) --cflags glib-2.0 json-glib-1.0 purple gnome-keyring-1)
+LIBPURPLE_LIBS += $(shell $(PKG_CONFIG) --libs glib-2.0 json-glib-1.0 purple)
+PLUGIN_DIR_PURPLE = $(shell $(PKG_CONFIG) --variable=plugindir purple)
+DATA_ROOT_DIR_PURPLE = $(shell $(PKG_CONFIG) --variable=datarootdir purple)
# Crypt backend to use
-CRYPT_BACKEND = nss
-
-ifeq (${CRYPT_BACKEND}, nss)
- CFLAGS += $(shell ${PKG_CONFIG} --cflags nss)
- LIBS += $(shell ${PKG_CONFIG} --libs nss)
-else ifeq (${CRYPT_BACKEND}, gcrypt)
- CFLAGS += $(shell libgcrypt-config --cflags) -DUSE_GCRYPT_CRYPTO
- LIBS += $(shell libgcrypt-config --libs)
+STEAM_CRYPT_BACKEND ?= nss
+
+ifeq ($(STEAM_CRYPT_BACKEND), nss)
+ LIBPURPLE_CFLAGS += $(shell ${PKG_CONFIG} --cflags nss)
+ LIBPURPLE_LIBS += $(shell ${PKG_CONFIG} --libs nss)
+else ifeq ($(STEAM_CRYPT_BACKEND), gcrypt)
+ LIBPURPLE_CFLAGS += $(shell libgcrypt-config --cflags) -DUSE_GCRYPT_CRYPTO
+ LIBPURPLE_LIBS += $(shell libgcrypt-config --libs)
endif
STEAM_SOURCES = \
@@ -26,8 +29,17 @@ STEAM_SOURCES = \
.PHONY: all clean install
all: libsteam.so
+install:
+ mkdir -m $(DIR_PERM) -p $(DESTDIR)$(PLUGIN_DIR_PURPLE)
+ install -m $(FILE_PERM) libsteam.so $(DESTDIR)$(PLUGIN_DIR_PURPLE)/$(PRPL_NAME)
+ mkdir -m $(DIR_PERM) -p $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/16
+ install -m $(FILE_PERM) steam16.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/16/steam.png
+ mkdir -m $(DIR_PERM) -p $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/22
+ install -m $(FILE_PERM) steam22.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/22/steam.png
+ mkdir -m $(DIR_PERM) -p $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/48
+ install -m $(FILE_PERM) steam48.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/48/steam.png
clean:
rm -f libsteam.so
-libsteam.so: ${STEAM_SOURCES}
- ${COMPILER} -Wall -I. -g -O2 -fPIC -pipe ${STEAM_SOURCES} -o $@ ${CFLAGS} ${LIBS} -shared
+libsteam.so: $(STEAM_SOURCES)
+ $(CC) -Wall -I. -fPIC $(CFLAGS) $(STEAM_SOURCES) -o $@ $(LIBPURPLE_CFLAGS) $(LIBPURPLE_LIBS) -shared