1moduledir = $(libdir)/irssi/modules
2
3perl_dirs = common irc ui textui
4
5module_LTLIBRARIES = $(perl_module_lib) $(perl_module_fe_lib)
6noinst_LTLIBRARIES = $(perl_static_lib) $(perl_static_fe_lib)
7EXTRA_LTLIBRARIES = \
8	libperl_core.la libfe_perl.la \
9	libperl_core_static.la libfe_perl_static.la
10
11libperl_core_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
12libfe_perl_la_LDFLAGS = -module -avoid-version -rpath $(moduledir)
13
14perl-core.lo: irssi-core.pl.h
15perl-signals.lo: perl-signals-list.h
16
17AM_CPPFLAGS = \
18	-I$(top_builddir) \
19	-I$(builddir) \
20	-I$(top_srcdir)/src \
21	-I$(top_srcdir)/src/core \
22	-I$(top_srcdir)/src/fe-common/core \
23	$(GLIB_CFLAGS) \
24	-DSCRIPTDIR=\""$(datadir)/irssi/scripts"\" \
25	-DPERL_USE_LIB=\""$(PERL_USE_LIB)"\" \
26	-DPERL_STATIC_LIBS=$(PERL_STATIC_LIBS) \
27	$(PERL_CFLAGS)
28
29perl_sources = \
30	perl-core.c \
31	perl-common.c \
32	perl-signals.c \
33	perl-sources.c
34
35perl_fe_sources = \
36	module-formats.c \
37	perl-fe.c
38
39noinst_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
48libperl_core_la_SOURCES = \
49	$(perl_sources)
50
51libperl_core_static_la_SOURCES = \
52	$(perl_sources)
53
54libfe_perl_la_SOURCES = \
55	$(perl_fe_sources)
56
57libfe_perl_static_la_SOURCES = \
58	$(perl_fe_sources)
59
60perl-signals-list.h: $(top_srcdir)/docs/signals.txt $(srcdir)/get-signals.pl
61	cat $(top_srcdir)/docs/signals.txt | $(perlpath) $(srcdir)/get-signals.pl > perl-signals-list.h
62
63irssi-core.pl.h: irssi-core.pl
64	$(top_srcdir)/utils/file2header.sh $(srcdir)/irssi-core.pl irssi_core_code > irssi-core.pl.h
65
66common_sources = \
67	common/Irssi.xs \
68	common/Irssi.pm \
69	common/Channel.xs \
70	common/Core.xs \
71	common/Expando.xs \
72	common/Ignore.xs \
73	common/Log.xs \
74	common/Masks.xs \
75	common/Query.xs \
76	common/Rawlog.xs \
77	common/Server.xs \
78	common/Settings.xs \
79	common/Makefile.PL.in \
80	common/typemap \
81	common/module.h
82
83irc_sources = \
84	irc/Irc.xs \
85	irc/Irc.pm \
86	irc/Dcc.xs \
87	irc/Channel.xs \
88	irc/Ctcp.xs \
89	irc/Query.xs \
90	irc/Server.xs \
91	irc/Modes.xs \
92	irc/Netsplit.xs \
93	irc/Notifylist.xs \
94	irc/Client.xs \
95	irc/Makefile.PL.in \
96	irc/typemap \
97	irc/module.h
98
99ui_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
109textui_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
119EXTRA_DIST = \
120	get-signals.pl \
121	irssi-core.pl \
122	Makefile_silent.pm \
123	$(common_sources) \
124	$(irc_sources) \
125	$(ui_sources) \
126	$(textui_sources)
127
128am_v_pl__show_gen = $(am__v_pl__show_gen_$(V))
129am_v_pl__hide_gen = $(am__v_pl__hide_gen_$(V))
130am__v_pl__show_gen_ = $(am__v_pl__show_gen_$(AM_DEFAULT_VERBOSITY))
131am__v_pl__hide_gen_ = $(am__v_pl__hide_gen_$(AM_DEFAULT_VERBOSITY))
132am__v_pl__show_gen_0 = echo "  GEN     " $$dir ;
133am__v_pl__hide_gen_0 = > /dev/null
134am__v_pl__show_gen_1 =
135am__v_pl__hide_gen_1 =
136
137all-local:
138	$(AM_V_GEN)for dir in $(perl_dirs); do \
139	  cd $$dir && \
140	  if [ ! -f Makefile ]; then \
141	    $(am_v_pl__show_gen)$(perlpath) Makefile.PL $(PERL_MM_PARAMS) $(am_v_pl__hide_gen); \
142	  fi && \
143	  ($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
144	   $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
145	  cd ..; \
146	done
147
148install-exec-local:
149	for dir in $(perl_dirs); do \
150	  cd $$dir && $(MAKE) pure_install && cd ..; \
151	done
152
153clean-generic:
154	for dir in $(perl_dirs); do \
155	  cd $$dir; \
156	  $(MAKE) clean; \
157	  cd ..; \
158	done
159
160distclean-generic:
161	for dir in $(perl_dirs); do \
162	  cd $$dir; \
163	  $(MAKE) realclean; rm -f Makefile.PL Makefile; \
164	  cd ..; \
165	done
166
167libperl_core_la_LIBADD = $(PERL_LDFLAGS)
168