Warning fix: Perl-side of the 3 FT data transferers expects char*, not unsigned.
[thrasher.git] / Makefile
blob5907f514dee43fd6a3cb6d7a7e0ef0775ae557eb
1 ### "config" options
2 PERL = /usr/bin/perl
3 GLIB_PREFIX = /usr
4 PURPLE_PREFIX = /usr
5 ### end of build config
7 PERL_INC := $(shell PERL5LIB= $(PERL) -MExtUtils::Embed -e ccopts -e ldpopts)
8 ifeq ($(PERL_INC),)
9 $(error "Cannot find PERL_INC for CFLAGS. Do you have ExtUtils::Embed?")
10 endif
12 GLIB_CFLAGS = -I$(GLIB_PREFIX)/include/glib-2.0 \
13 -I$(GLIB_PREFIX)/include/glib-2.0/glib \
14 -I$(GLIB_PREFIX)/lib/glib-2.0/include \
15 -I$(PURPLE_PREFIX)/include/libpurple \
16 -DPURPLE_DISABLE_DEPRECATED \
17 $(PERL_INC)
19 GLIB_LIBS := -L$(GLIB_PREFIX)/lib \
20 -lpurple \
21 -lgobject-2.0 \
22 -lgmodule-2.0 \
23 -lgthread-2.0 \
24 -lglib-2.0 \
25 -ldl \
26 $(shell PERL5LIB= $(PERL) -MConfig -e'print "-L$$Config::Config{archlibexp}/CORE";') \
27 -lperl \
28 -lcrypt \
29 -lrt
31 CFLAGS = -Wall \
32 -Waggregate-return \
33 -Wcast-align \
34 -Werror-implicit-function-declaration \
35 -Wmissing-declarations \
36 -Wmissing-prototypes \
37 -Wnested-externs \
38 -Wpointer-arith \
39 -Wundef \
40 -O2
42 DEBUG_CFLAGS = -DTH_DEBUG \
43 -DERROR_DEBUG
45 DEBUG_GLIB = -g \
46 -ggdb
48 DEPDIR = .deps
49 OBJS = thperl.o \
50 thblist.o \
51 thrasher.o \
52 thpresence.o \
53 thconnection.o \
54 threquest.o \
55 thconversations.o \
56 thft.o
58 COMPILE = gcc -DHAVE_CONFIG_H -I. $(GLIB_CFLAGS) $(DEBUG_CFLAGS) $(CFLAGS)
59 WRAPPER = THPPW
60 WRAPPER_PATH = perl/lib
63 .PHONY: clean again
65 all: $(DEPDIR) $(OBJS) thperl_wrap.c wrapper
67 wrapper: $(WRAPPER_PATH)/$(WRAPPER).pm thperl_wrap.o $(WRAPPER).so
69 thperl_wrap.o: thperl_wrap.c
70 $(CC) $(DEBUG_CFLAGS) $(DEBUG_GLIB) -fPIC -c thperl.c thperl_wrap.c -fPIC $(GLIB_CFLAGS)
72 $(WRAPPER).so: $(OBJS) thperl_wrap.o
73 $(CC) -shared $(GLIB_LIBS) $(OBJS) thperl_wrap.o -o $(WRAPPER).so
75 thperl_wrap.c $(WRAPPER_PATH)/$(WRAPPER).pm: thperl.h
76 swig -I$(PURPLE_PREFIX)/include $(DEBUG_CFLAGS) -perl -outdir $(WRAPPER_PATH) thperl.h
78 $(DEPDIR):
79 if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi
81 .c.o:
82 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
83 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
85 again: clean all
87 clean:
88 $(RM) -f $(OBJS)
89 $(RM) -rf $(DEPDIR)
90 $(RM) -f thperl_wrap.*
91 $(RM) -f $(WRAPPER).so
92 $(RM) -f $(WRAPPER_PATH)/$(WRAPPER).pm $(WRAPPER).pm