5 ### end of build config
7 PERL_CFLAGS
:= $(shell PERL5LIB
= $(PERL
) -MExtUtils
::Embed
-e ccopts
)
8 PERL_CFLAGS
:= $(subst -Wdeclaration-after-statement
,,$(PERL_CFLAGS
))
10 ifeq ($(PERL_CFLAGS
),)
11 $(error
"Cannot find PERL_CFLAGS. Do you have ExtUtils::Embed?")
15 $(shell PERL5LIB
= $(PERL
) -MExtUtils
::Embed
-e ldopts
) \
16 $(shell PERL5LIB
= $(PERL
) -MConfig
-e
'print "-L$$Config::Config{archlibexp}/CORE";')
18 GLIB_CFLAGS
= -I
$(GLIB_PREFIX
)/include/glib-2.0 \
19 -I
$(GLIB_PREFIX
)/include/glib-2.0
/glib \
20 -I
$(GLIB_PREFIX
)/lib
/glib-2.0
/include \
21 -I
$(PURPLE_PREFIX
)/include/libpurple \
22 -DPURPLE_DISABLE_DEPRECATED \
25 GLIB_LIBS
:= -L
$(GLIB_PREFIX
)/lib \
36 -Werror-implicit-function-declaration \
37 -Wmissing-declarations \
38 -Wmissing-prototypes \
44 DEBUG_CFLAGS
= -DTH_DEBUG \
60 COMPILE
= gcc
-DHAVE_CONFIG_H
-I.
$(GLIB_CFLAGS
) $(DEBUG_CFLAGS
) $(CFLAGS
)
62 WRAPPER_PATH
= perl
/lib
67 all: $(DEPDIR
) $(OBJS
) thperl_wrap.c wrapper
69 wrapper
: $(WRAPPER_PATH
)/$(WRAPPER
).pm thperl_wrap.o
$(WRAPPER
).so
71 thperl_wrap.o
: thperl_wrap.c
72 $(CC
) $(DEBUG_CFLAGS
) $(DEBUG_GLIB
) -fPIC
-c thperl.c thperl_wrap.c
-fPIC
$(GLIB_CFLAGS
)
74 $(WRAPPER
).so
: $(OBJS
) thperl_wrap.o
75 $(CC
) -shared
$(GLIB_LIBS
) $(PERL_LIBS
) $(OBJS
) thperl_wrap.o
-o
$(WRAPPER
).so
77 thperl_wrap.c
$(WRAPPER_PATH
)/$(WRAPPER
).pm
: thperl.h
78 swig
-I
$(PURPLE_PREFIX
)/include $(DEBUG_CFLAGS
) -perl
-outdir
$(WRAPPER_PATH
) thperl.h
81 if
test ! -d
$(DEPDIR
); then mkdir
$(DEPDIR
); fi
84 $(COMPILE
) -MT
$@
-MD
-MP
-MF
$(DEPDIR
)/$*.Tpo
-c
-o
$@
$<
85 mv
-f
$(DEPDIR
)/$*.Tpo
$(DEPDIR
)/$*.Po
92 $(RM
) -f thperl_wrap.
*
93 $(RM
) -f
$(WRAPPER
).so
94 $(RM
) -f
$(WRAPPER_PATH
)/$(WRAPPER
).pm
$(WRAPPER
).pm