5 ### end of build config
7 PERL_INC
:= $(shell PERL5LIB
= $(PERL
) -MExtUtils
::Embed
-e ccopts
-e ldpopts
)
9 $(error
"Cannot find PERL_INC for CFLAGS. Do you have ExtUtils::Embed?")
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 \
19 GLIB_LIBS
:= -L
$(GLIB_PREFIX
)/lib \
26 $(shell PERL5LIB
= $(PERL
) -MConfig
-e
'print "-L$$Config::Config{archlibexp}/CORE";') \
34 -Werror-implicit-function-declaration \
35 -Wmissing-declarations \
36 -Wmissing-prototypes \
42 DEBUG_CFLAGS
= -DTH_DEBUG \
58 COMPILE
= gcc
-DHAVE_CONFIG_H
-I.
$(GLIB_CFLAGS
) $(DEBUG_CFLAGS
) $(CFLAGS
)
60 WRAPPER_PATH
= perl
/lib
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
79 if
test ! -d
$(DEPDIR
); then mkdir
$(DEPDIR
); fi
82 $(COMPILE
) -MT
$@
-MD
-MP
-MF
$(DEPDIR
)/$*.Tpo
-c
-o
$@
$<
83 mv
-f
$(DEPDIR
)/$*.Tpo
$(DEPDIR
)/$*.Po
90 $(RM
) -f thperl_wrap.
*
91 $(RM
) -f
$(WRAPPER
).so
92 $(RM
) -f
$(WRAPPER_PATH
)/$(WRAPPER
).pm
$(WRAPPER
).pm