1 |
# |
2 |
# Makefile.in for ircd/modules |
3 |
# |
4 |
# $Id$ |
5 |
# |
6 |
CC = @CC@ |
7 |
AR = @AR@ |
8 |
RM = @RM@ |
9 |
SED = @SED@ |
10 |
SEDOBJ = @SEDOBJ@ |
11 |
STDOUT = @STDOUT@ |
12 |
CFLAGS = @IRC_CFLAGS@ |
13 |
PICFLAGS = @PICFLAGS@ |
14 |
MKDEP = @MKDEP@ |
15 |
INSTALL = @INSTALL@ |
16 |
INSTALL_DATA = @INSTALL_DATA@ |
17 |
MV = @MV@ |
18 |
LD = @LD@ |
19 |
|
20 |
SSL_LIBS = @SSL_LIBS@ |
21 |
SSL_INCLUDES = @SSL_INCLUDES@ |
22 |
IRCDLIBS = @LIBS@ $(SSL_LIBS) |
23 |
|
24 |
prefix = $(DESTDIR)@prefix@ |
25 |
datarootdir = $(DESTDIR)@datarootdir@ |
26 |
# Change this later! -- adrian |
27 |
moduledir = ${prefix}/modules |
28 |
automoduledir = ${moduledir}/autoload |
29 |
|
30 |
INCLUDES = -I../include -I../lib/pcre $(SSL_INCLUDES) |
31 |
CPPFLAGS = ${INCLUDES} @CPPFLAGS@ |
32 |
|
33 |
CORE_SRCS = \ |
34 |
core/m_die.c \ |
35 |
core/m_join.c \ |
36 |
core/m_kick.c \ |
37 |
core/m_kill.c \ |
38 |
core/m_message.c \ |
39 |
core/m_mode.c \ |
40 |
core/m_nick.c \ |
41 |
core/m_part.c \ |
42 |
core/m_quit.c \ |
43 |
core/m_server.c \ |
44 |
core/m_sjoin.c \ |
45 |
core/m_squit.c |
46 |
|
47 |
SSL_SRCS = \ |
48 |
m_challenge.c \ |
49 |
m_cryptlink.c |
50 |
|
51 |
SRCS = \ |
52 |
m_accept.c \ |
53 |
m_admin.c \ |
54 |
m_away.c \ |
55 |
m_cap.c \ |
56 |
m_capab.c \ |
57 |
m_cburst.c \ |
58 |
m_close.c \ |
59 |
@SSL_SRCS_ENABLE@ \ |
60 |
m_connect.c \ |
61 |
m_drop.c \ |
62 |
m_encap.c \ |
63 |
m_eob.c \ |
64 |
m_etrace.c \ |
65 |
m_hash.c \ |
66 |
m_help.c \ |
67 |
m_gline.c \ |
68 |
m_info.c \ |
69 |
m_invite.c \ |
70 |
m_ison.c \ |
71 |
m_kline.c \ |
72 |
m_knock.c \ |
73 |
m_links.c \ |
74 |
m_list.c \ |
75 |
m_lljoin.c \ |
76 |
m_llnick.c \ |
77 |
m_locops.c \ |
78 |
m_lusers.c \ |
79 |
m_map.c \ |
80 |
m_motd.c \ |
81 |
m_names.c \ |
82 |
m_nburst.c \ |
83 |
m_omotd.c \ |
84 |
m_oper.c \ |
85 |
m_operwall.c \ |
86 |
m_pass.c \ |
87 |
m_ping.c \ |
88 |
m_pong.c \ |
89 |
m_post.c \ |
90 |
m_rehash.c \ |
91 |
m_restart.c \ |
92 |
m_resv.c \ |
93 |
m_rkline.c \ |
94 |
m_rxline.c \ |
95 |
m_set.c \ |
96 |
m_stats.c \ |
97 |
m_svinfo.c \ |
98 |
m_tburst.c \ |
99 |
m_testmask.c \ |
100 |
m_testline.c \ |
101 |
m_time.c \ |
102 |
m_topic.c \ |
103 |
m_trace.c \ |
104 |
m_user.c \ |
105 |
m_userhost.c \ |
106 |
m_users.c \ |
107 |
m_version.c \ |
108 |
m_wallops.c \ |
109 |
m_who.c \ |
110 |
m_whois.c \ |
111 |
m_whowas.c \ |
112 |
m_xline.c |
113 |
|
114 |
ALL_SRCS = $(CORE_SRCS) $(SRCS) @SSL_SRCS_ENABLE@ |
115 |
|
116 |
SH_OBJS = ${SRCS:.c=.so} |
117 |
SH_CORE_OBJS = ${CORE_SRCS:.c=.so} |
118 |
|
119 |
HPUX_OBJS = ${SH_OBJS:.so=.sl} |
120 |
HPUX_CORE_OBJS = ${SH_CORE_OBJS:.so=.sl} |
121 |
|
122 |
S_OBJS = ${ALL_SRCS:.c=.o} |
123 |
|
124 |
default: build |
125 |
build: all |
126 |
all: .depend @MOD_TARGET@ |
127 |
|
128 |
shared_modules: $(SH_CORE_OBJS) $(SH_OBJS) |
129 |
|
130 |
hpux_shared: $(SH_CORE_OBJS) $(SH_OBJS) $(HPUX_CORE_OBJS) $(HPUX_OBJS) |
131 |
|
132 |
libmodules.a: $(S_OBJS) |
133 |
$(RM) -f $@ |
134 |
$(AR) csrv $@ $(S_OBJS) |
135 |
|
136 |
install-mkdirs: |
137 |
mkdir -p $(prefix) |
138 |
|
139 |
-@if test -d $(moduledir)-old; then \ |
140 |
echo "${RM} -rf $(moduledir)-old"; \ |
141 |
${RM} -rf $(moduledir)-old; \ |
142 |
fi |
143 |
-@if test -d $(moduledir); then \ |
144 |
echo "${MV} $(moduledir) $(moduledir)-old"; \ |
145 |
${MV} $(moduledir) $(moduledir)-old; \ |
146 |
fi |
147 |
|
148 |
mkdir -p $(moduledir) $(automoduledir) |
149 |
|
150 |
install: install_@MOD_TARGET@ |
151 |
|
152 |
install_libmodules.a: libmodules.a |
153 |
# Ye olde noop here. |
154 |
|
155 |
install_shared_modules: install-mkdirs |
156 |
@echo "Installing core modules into $(moduledir) .." |
157 |
@for file in $(SH_CORE_OBJS); do \ |
158 |
$(INSTALL_DATA) $$file $(moduledir); \ |
159 |
done |
160 |
@echo "Installing modules into $(automoduledir) .." |
161 |
@for file in $(SH_OBJS); do \ |
162 |
$(INSTALL_DATA) $$file $(automoduledir); \ |
163 |
done |
164 |
|
165 |
install_hpux_shared: install-mkdirs |
166 |
@echo "Installing core modules into $(moduledir) .." |
167 |
@for file in $(HPUX_CORE_OBJS); do \ |
168 |
$(INSTALL_DATA) $$file $(moduledir); \ |
169 |
done |
170 |
@echo "Installing modules into $(automoduledir) .." |
171 |
@for file in $(HPUX_OBJS); do \ |
172 |
$(INSTALL_DATA) $$file $(automoduledir); \ |
173 |
done |
174 |
|
175 |
.SUFFIXES: .sl .so .o |
176 |
|
177 |
.c.o: |
178 |
${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@ |
179 |
|
180 |
.c.so: |
181 |
${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@ |
182 |
|
183 |
.so.sl: |
184 |
$(LD) -b $< -o $@ |
185 |
|
186 |
.depend: |
187 |
${MKDEP} ${CPPFLAGS} ${ALL_SRCS} ${STDOUT} |
188 |
${SED} -e '${SEDOBJ}' < .depend > .depend.tmp-1 |
189 |
${SED} -e 's/^m_\(server\|squit\|die\|join\|kick\|kill\|message\|mode\|nick\|part\|quit\|sjoin\)/core\/m_\1/' .depend.tmp-1 > .depend.tmp |
190 |
@${SED} -e '/^# Autogenerated - do not delete/,$$d' <Makefile >Makefile.depend |
191 |
@echo '# Autogenerated - do not delete' >>Makefile.depend |
192 |
@echo 'include .depend' >> Makefile.depend |
193 |
@${MV} Makefile.depend Makefile |
194 |
${MV} -f .depend.tmp .depend |
195 |
${RM} -f .depend.tmp-1 |
196 |
|
197 |
clean: |
198 |
${RM} -f *.so *.sl *~ *.o *.a so_locations |
199 |
${RM} -f core/*.so core/*.sl core/*~ core/*.o |
200 |
|
201 |
distclean: clean |
202 |
${RM} -f Makefile .depend |
203 |
|
204 |
.PHONY: clean distclean install install_hpux_shared hpux_shared install_shared_modules shared_modules install_libmodules.a install-mkdirs build |