Merged silc_1_1_branch to trunk.
[silc.git] / apps / irssi / src / perl / Makefile.am
1 LIBTOOL = $(PERL_LIBTOOL)
2
3 include $(top_srcdir)/Makefile.defines.in
4
5 moduledir = @SILC_IRSSIDIR@
6
7 if SILCPLUGIN
8 perl_dirs = silc
9 SCRIPTDIR="$(datadir)/irssi/scripts"
10 else
11 perl_dirs = common ui textui silc
12 SCRIPTDIR="$(datadir)/silc/scripts"
13 endif
14
15
16 module_LTLIBRARIES = $(perl_module_lib) $(perl_module_fe_lib)
17 noinst_LTLIBRARIES = $(perl_static_lib) $(perl_static_fe_lib)
18 EXTRA_LTLIBRARIES = \
19         libperl_core.la libfe_perl.la \
20         libperl_core_static.la libfe_perl_static.la
21
22 libperl_core_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
23 libfe_perl_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
24
25 perl-core.c: perl-signals-list.h irssi-core.pl.h
26
27 INCLUDES += \
28         -I$(top_srcdir)/src \
29         -I$(top_srcdir)/src/core \
30         -I$(top_srcdir)/src/fe-common/core \
31         -I$(top_srcdir)/src/fe-common/silc \
32         $(GLIB_CFLAGS) \
33         -DSCRIPTDIR=\""$(SCRIPTDIR)"\" \
34         -DPERL_USE_LIB=\""$(PERL_USE_LIB)"\" \
35         -DPERL_STATIC_LIBS=$(PERL_STATIC_LIBS) \
36         $(PERL_CFLAGS)
37
38 perl_sources = \
39         perl-core.c \
40         perl-common.c \
41         perl-signals.c \
42         perl-sources.c
43
44 perl_fe_sources = \
45         module-formats.c \
46         perl-fe.c
47
48 noinst_HEADERS = \
49         module.h \
50         module-fe.h \
51         module-formats.h \
52         perl-core.h \
53         perl-common.h \
54         perl-signals.h \
55         perl-sources.h
56
57 libperl_core_la_DEPENDENCIES = .libs/libperl_orig.a .libs/DynaLoader.a
58
59 .libs/libperl_orig.a:
60         if [ ! -d .libs ]; then mkdir .libs; fi
61         rm -f .libs/libperl_orig.a
62         if [ x$(LIBPERL_A) = x ]; then touch .libs/libperl_orig.a; else $(LN_S) $(LIBPERL_A) .libs/libperl_orig.a; fi
63 .libs/DynaLoader.a:
64         if [ ! -d .libs ]; then mkdir .libs; fi
65         rm -f .libs/DynaLoader.a
66         $(LN_S) $(DYNALOADER_A) .libs/DynaLoader.a
67
68 libperl_core_la_SOURCES = \
69         $(perl_sources)
70
71 libperl_core_static_la_SOURCES = \
72         $(perl_sources)
73
74 libfe_perl_la_SOURCES = \
75         $(perl_fe_sources)
76
77 libfe_perl_static_la_SOURCES = \
78         $(perl_fe_sources)
79
80 perl-signals-list.h: $(top_srcdir)/docs/signals.txt $(srcdir)/get-signals.pl
81         cat $(top_srcdir)/docs/signals.txt | $(perlpath) $(srcdir)/get-signals.pl > perl-signals-list.h
82
83 irssi-core.pl.h: irssi-core.pl
84         $(top_srcdir)/file2header.sh $(srcdir)/irssi-core.pl irssi_core_code > irssi-core.pl.h
85
86 common_sources = \
87         common/Irssi.xs \
88         common/Irssi.pm \
89         common/Channel.xs \
90         common/Core.xs \
91         common/Expando.xs \
92         common/Ignore.xs \
93         common/Log.xs \
94         common/Masks.xs \
95         common/Query.xs \
96         common/Rawlog.xs \
97         common/Server.xs \
98         common/Settings.xs \
99         common/Makefile.PL.in \
100         common/typemap \
101         common/module.h
102
103 ui_sources = \
104         ui/UI.xs \
105         ui/UI.pm \
106         ui/Formats.xs \
107         ui/Themes.xs \
108         ui/Window.xs \
109         ui/Makefile.PL.in \
110         ui/typemap \
111         ui/module.h
112
113 textui_sources = \
114         textui/TextUI.xs \
115         textui/TextUI.pm \
116         textui/TextBuffer.xs \
117         textui/TextBufferView.xs \
118         textui/Statusbar.xs \
119         textui/Makefile.PL.in \
120         textui/typemap \
121         textui/module.h
122
123 silc_sources = \
124         silc/Silc.xs \
125         silc/Silc.pm \
126         silc/Channel.xs \
127         silc/Server.xs \
128         silc/Query.xs \
129         silc/typemap \
130         silc/module.h
131
132 EXTRA_DIST = \
133         libperl_dynaloader.la \
134         libperl_orig.la \
135         get-signals.pl \
136         irssi-core.pl \
137         $(common_sources) \
138         $(ui_sources) \
139         $(textui_sources) \
140         $(silc_sources)
141
142 all-local:
143         for dir in $(perl_dirs); do \
144           cd $$dir && \
145           if [ ! -f Makefile ]; then \
146             $(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
147           fi && \
148           ($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
149            $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
150           cd ..; \
151         done
152
153 install-exec-local:
154         for dir in $(perl_dirs); do \
155           cd $$dir && $(MAKE) install && cd ..; \
156         done
157
158 clean-generic:
159         for dir in $(perl_dirs); do \
160           cd $$dir; \
161           $(MAKE) clean; \
162           cd ..; \
163         done
164
165 distclean-generic:
166         for dir in $(perl_dirs); do \
167           cd $$dir; \
168           $(MAKE) realclean; rm -f Makefile.PL Makefile; \
169           cd ..; \
170         done
171
172 libperl_core_la_LIBADD = $(PERL_LDFLAGS)