Sun May 13 16:54:35 CEST 2007 Jochen Eisinger <coffee@silcnet.org>
[silc.git] / apps / irssi / src / perl / Makefile.am
index 7e0be0231a7f06c4a77285d2e1d5a6d33034d22e..3b978476929d241fe4b62b83ce54430d76cc7dc3 100644 (file)
@@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.defines.in
 
 moduledir = $(silc_modulesdir)
 
-perl_dirs = common ui textui
+perl_dirs = common ui textui silc
 
 module_LTLIBRARIES = $(perl_module_lib) $(perl_module_fe_lib)
 noinst_LTLIBRARIES = $(perl_static_lib) $(perl_static_fe_lib)
@@ -12,18 +12,18 @@ EXTRA_LTLIBRARIES = \
        libperl_core.la libfe_perl.la \
        libperl_core_static.la libfe_perl_static.la
 
-libperl_core_la_LDFLAGS = -avoid-version -rpath $(moduledir)
-libfe_perl_la_LDFLAGS = -avoid-version -rpath $(moduledir)
+libperl_core_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
+libfe_perl_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
 
 perl-core.c: perl-signals-list.h irssi-core.pl.h
 
-INCLUDES = \
+INCLUDES += \
        -I$(top_srcdir)/src \
        -I$(top_srcdir)/src/core \
        -I$(top_srcdir)/src/fe-common/core \
        -I$(top_srcdir)/src/fe-common/silc \
        $(GLIB_CFLAGS) \
-       -DSCRIPTDIR=\""$(libdir)/silc/scripts"\" \
+       -DSCRIPTDIR=\""$(datadir)/silc/scripts"\" \
        -DPERL_USE_LIB=\""$(PERL_USE_LIB)"\" \
        -DPERL_STATIC_LIBS=$(PERL_STATIC_LIBS) \
        $(PERL_CFLAGS)
@@ -81,6 +81,7 @@ common_sources = \
        common/Irssi.pm \
        common/Channel.xs \
        common/Core.xs \
+       common/Expando.xs \
        common/Ignore.xs \
        common/Log.xs \
        common/Masks.xs \
@@ -112,6 +113,15 @@ textui_sources = \
        textui/typemap \
        textui/module.h
 
+silc_sources = \
+       silc/Silc.xs \
+       silc/Silc.pm \
+       silc/Channel.xs \
+       silc/Server.xs \
+       silc/Query.xs \
+       silc/typemap \
+       silc/module.h
+
 EXTRA_DIST = \
        libperl_dynaloader.la \
        libperl_orig.la \
@@ -119,15 +129,17 @@ EXTRA_DIST = \
        irssi-core.pl \
        $(common_sources) \
        $(ui_sources) \
-       $(textui_sources)
+       $(textui_sources) \
+       $(silc_sources)
 
 all-local:
        for dir in $(perl_dirs); do \
          cd $$dir && \
          if [ ! -f Makefile ]; then \
-            $(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
+           $(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
          fi && \
-         ($(MAKE) || $(MAKE)) && \
+         ($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
+          $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
          cd ..; \
        done
 
@@ -137,12 +149,16 @@ install-exec-local:
        done
 
 clean-generic:
-       for dir in $(perl_dirs); do rm -f $$dir/Makefile; done
+       for dir in $(perl_dirs); do \
+         cd $$dir; \
+         $(MAKE) clean; \
+         cd ..; \
+       done
 
 distclean-generic:
        for dir in $(perl_dirs); do \
          cd $$dir; \
-         $(MAKE) realclean; rm -f Makefile.PL; \
+         $(MAKE) realclean; rm -f Makefile.PL Makefile; \
          cd ..; \
        done