| 1 | # Makefile "stolen" from pidgin-qip: http://fialky.com/drupal-5.0/?q=node/13 |
| 2 | |
| 3 | OS=linux |
| 4 | CC=gcc |
| 5 | |
| 6 | # |
| 7 | # Linux Build Specifics: |
| 8 | # |
| 9 | ifeq ($(OS), linux) |
| 10 | #TARGET=pidgin-qip.so |
| 11 | TARGET=qip-decoder.so |
| 12 | CFLAGS+=`pkg-config pidgin --cflags` -fPIC |
| 13 | LDFLAGS+=`pkg-config pidgin --libs` -shared |
| 14 | PREFIX?=/usr/ |
| 15 | PIDGIN_PLUGIN_PATH ?= $(PREFIX)/lib/pidgin/ |
| 16 | endif |
| 17 | |
| 18 | |
| 19 | # |
| 20 | # Windows Build Specifics |
| 21 | # |
| 22 | ifeq ($(OS), win32) |
| 23 | #TARGET = pidgin-qip.dll |
| 24 | TARGET = qip-decoder.dll |
| 25 | |
| 26 | # Windows users, please check out this : |
| 27 | |
| 28 | # Please install the pidgin gtk package (check the readme) |
| 29 | GTK=C:/cygwin/work/win32-dev/gtk_2_0 |
| 30 | # Please download pidgin corresponding sources, we need them |
| 31 | PIDGINSRC=C:/cygwin/work/pidgin-2.3.1 |
| 32 | # You need to have pidgin installed, please tell us where |
| 33 | PIDGIN=C:/Program\ Files/Pidgin |
| 34 | # Pidgin plugins default directory, it should be OK |
| 35 | PIDGIN_PLUGIN_PATH=$(PIDGIN)/plugins |
| 36 | |
| 37 | # Nothing to modify after this point: |
| 38 | # Include dirs |
| 39 | CFLAGS+=-I$(GTK)/include |
| 40 | CFLAGS+=-I$(GTK)/include/glib-2.0 |
| 41 | CFLAGS+=-I$(GTK)/include/atk-1.0 |
| 42 | CFLAGS+=-I$(GTK)/include/gtk-2.0 |
| 43 | CFLAGS+=-I$(GTK)/include/pango-1.0 |
| 44 | CFLAGS+=-I$(GTK)/lib/gtk-2.0/include |
| 45 | CFLAGS+=-I$(GTK)/lib/glib-2.0/include |
| 46 | CFLAGS+=-I$(PIDGINSRC)/pidgin |
| 47 | CFLAGS+=-I$(PIDGINSRC)/pidgin/win32 |
| 48 | CFLAGS+=-I$(PIDGINSRC)/libpurple |
| 49 | |
| 50 | LDFLAGS=-shared -L$(GTK)/lib -L$(PIDGIN) |
| 51 | LDFLAGS+=-latk-1.0 -lgtk-win32-2.0.dll |
| 52 | LDFLAGS+=-lpidgin -lpurple -lintl -lgmodule-2.0.dll |
| 53 | LDFLAGS+=-lglib-2.0.dll -lgdk-win32-2.0.dll |
| 54 | LDFLAGS+=-lgdk_pixbuf-2.0.dll |
| 55 | LDFLAGS+=-lgobject-2.0.dll |
| 56 | LDFLAGS+=-lpango-1.0.dll |
| 57 | LDFLAGS+=-lpangowin32-1.0.dll |
| 58 | CC=gcc |
| 59 | INSTALL=cp |
| 60 | RM=erase |
| 61 | endif |
| 62 | |
| 63 | # Debug selection, use 'make NODEBUG=1' |
| 64 | NODEBUG=0 |
| 65 | ifeq ($(NODEBUG), 0 ) |
| 66 | CFLAGS+=-g |
| 67 | endif |
| 68 | |
| 69 | RM?=rm |
| 70 | INSTALL?=install -D |
| 71 | |
| 72 | # Objects rules ... |
| 73 | |
| 74 | #OBJS=pidgin-qip.o |
| 75 | OBJS=qip-decoder.o |
| 76 | #OBJS+=urlhandler.o |
| 77 | #OBJS+=plugin.o |
| 78 | #OBJS+=ui.o |
| 79 | |
| 80 | CFLAGS+=-Wall -Werror |
| 81 | |
| 82 | $(TARGET): $(OBJS) |
| 83 | $(CC) -o $(TARGET) $(OBJS) $(LDFLAGS) $(CFLAGS) |
| 84 | |
| 85 | #pidgin-qip.o: pidgin-qip.c pidgin-qip.h |
| 86 | #urlhandler.o: urlhandler.c pidgin-qip.h |
| 87 | #plugin.o: plugin.c pidgin-qip.h |
| 88 | #ui.o: ui.c pidgin-qip.h |
| 89 | pidgin-qip.o: pidgin-qip.c |
| 90 | qip-decoder.o: qip-decoder.c |
| 91 | |
| 92 | .PHONY: clean |
| 93 | clean: |
| 94 | $(RM) $(TARGET) $(OBJS) |
| 95 | |
| 96 | .PHONY: install |
| 97 | install: $(TARGET) |
| 98 | $(INSTALL) $(TARGET) $(PIDGIN_PLUGIN_PATH)/ |