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