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
= $(shell pkg-config
--cflags glib-2.0
) \
19 -I
$(PURPLE_PREFIX
)/include/libpurple \
20 -DPURPLE_DISABLE_DEPRECATED \
23 GLIB_LIBS
:= -L
$(GLIB_PREFIX
)/lib \
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
62 ifeq ($(shell uname
-m
), x86_64
)
63 COMPILE
:= $(COMPILE
) -fPIC
68 all: $(DEPDIR
) $(OBJS
) thperl_wrap.c wrapper
70 wrapper
: $(WRAPPER_PATH
)/$(WRAPPER
).pm thperl_wrap.o
$(WRAPPER
).so
72 thperl_wrap.o
: thperl_wrap.c
73 $(CC
) $(DEBUG_CFLAGS
) $(DEBUG_GLIB
) -fPIC
-c thperl.c thperl_wrap.c
$(GLIB_CFLAGS
)
75 $(WRAPPER
).so
: $(OBJS
) thperl_wrap.o
76 $(CC
) -shared
$(GLIB_LIBS
) $(PERL_LIBS
) $(OBJS
) thperl_wrap.o
-o
$(WRAPPER
).so
78 thperl_wrap.c
$(WRAPPER_PATH
)/$(WRAPPER
).pm
: thperl.h
79 swig
-I
$(PURPLE_PREFIX
)/include $(DEBUG_CFLAGS
) -perl
-outdir
$(WRAPPER_PATH
) thperl.h
82 if
test ! -d
$(DEPDIR
); then mkdir
$(DEPDIR
); fi
85 $(COMPILE
) -MT
$@
-MD
-MP
-MF
$(DEPDIR
)/$*.Tpo
-c
-o
$@
$<
86 mv
-f
$(DEPDIR
)/$*.Tpo
$(DEPDIR
)/$*.Po
93 $(RM
) -f thperl_wrap.
*
94 $(RM
) -f
$(WRAPPER
).so
95 $(RM
) -f
$(WRAPPER_PATH
)/$(WRAPPER
).pm
$(WRAPPER
).pm