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