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