5 ### end of build config
7 PERL_CFLAGS
:= $(shell PERL5LIB
= $(PERL
) -MExtUtils
::Embed
-e ccopts
)
10 $(error
"Cannot find PERL_CFLAGS. Do you have ExtUtils::Embed?")
14 $(shell PERL5LIB
= $(PERL
) -MExtUtils
::Embed
-e ldopts
) \
15 $(shell PERL5LIB
= $(PERL
) -MConfig
-e
'print "-L$$Config::Config{archlibexp}/CORE";')
17 GLIB_CFLAGS
= -I
$(GLIB_PREFIX
)/include/glib-2.0 \
18 -I
$(GLIB_PREFIX
)/include/glib-2.0
/glib \
19 -I
$(GLIB_PREFIX
)/lib
/glib-2.0
/include \
20 -I
$(PURPLE_PREFIX
)/include/libpurple \
21 -DPURPLE_DISABLE_DEPRECATED \
24 GLIB_LIBS
:= -L
$(GLIB_PREFIX
)/lib \
35 -Werror-implicit-function-declaration \
36 -Wmissing-declarations \
37 -Wmissing-prototypes \
43 DEBUG_CFLAGS
= -DTH_DEBUG \
59 COMPILE
= gcc
-DHAVE_CONFIG_H
-I.
$(GLIB_CFLAGS
) $(DEBUG_CFLAGS
) $(CFLAGS
)
61 WRAPPER_PATH
= perl
/lib
66 all: $(DEPDIR
) $(OBJS
) thperl_wrap.c wrapper
68 wrapper
: $(WRAPPER_PATH
)/$(WRAPPER
).pm thperl_wrap.o
$(WRAPPER
).so
70 thperl_wrap.o
: thperl_wrap.c
71 $(CC
) $(DEBUG_CFLAGS
) $(DEBUG_GLIB
) -fPIC
-c thperl.c thperl_wrap.c
-fPIC
$(GLIB_CFLAGS
)
73 $(WRAPPER
).so
: $(OBJS
) thperl_wrap.o
74 $(CC
) -shared
$(GLIB_LIBS
) $(PERL_LIBS
) $(OBJS
) thperl_wrap.o
-o
$(WRAPPER
).so
76 thperl_wrap.c
$(WRAPPER_PATH
)/$(WRAPPER
).pm
: thperl.h
77 swig
-I
$(PURPLE_PREFIX
)/include $(DEBUG_CFLAGS
) -perl
-outdir
$(WRAPPER_PATH
) thperl.h
80 if
test ! -d
$(DEPDIR
); then mkdir
$(DEPDIR
); fi
83 $(COMPILE
) -MT
$@
-MD
-MP
-MF
$(DEPDIR
)/$*.Tpo
-c
-o
$@
$<
84 mv
-f
$(DEPDIR
)/$*.Tpo
$(DEPDIR
)/$*.Po
91 $(RM
) -f thperl_wrap.
*
92 $(RM
) -f
$(WRAPPER
).so
93 $(RM
) -f
$(WRAPPER_PATH
)/$(WRAPPER
).pm
$(WRAPPER
).pm