2 # Makefile.in for ircd/modules
4 # $Id: Makefile.in 3372 2007-04-03 10:18:07Z nenolod $
13 CFLAGS = @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
15 MKDEP = @MKDEP@ -DIRCD_PREFIX=\"@prefix@\"
17 INSTALL_PROGRAM = @INSTALL_PROGRAM@
18 INSTALL_DATA = @INSTALL_DATA@
19 INSTALL_SUID = @INSTALL_PROGRAM@ -o root -m 4755
26 SSL_INCLUDES = @SSL_INCLUDES@
28 IRCDLIBS = @LIBS@ $(SSL_LIBS)
31 exec_prefix = @exec_prefix@
33 pkglibdir = @pkglibdir@
34 moduledir = @moduledir@
35 PACKAGE_TARNAME = @PACKAGE_TARNAME@
36 # Change this later! -- adrian
37 automoduledir = @moduledir@/autoload
39 INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES)
40 CPPFLAGS = ${INCLUDES} @CPPFLAGS@
128 ALL_SRCS = $(CORE_SRCS) \
131 SH_OBJS = ${SRCS:.c=.so}
132 SH_CORE_OBJS = ${CORE_SRCS:.c=.so}
134 HPUX_OBJS = ${SH_OBJS:.so=.sl}
135 HPUX_CORE_OBJS = ${SH_CORE_OBJS:.so=.sl}
137 S_OBJS = ${ALL_SRCS:.c=.o}
145 shared_modules: $(SH_CORE_OBJS) $(SH_OBJS)
147 hpux_modules: $(HPUX_CORE_OBJS) $(HPUX_OBJS)
149 hpux_shared: $(SH_CORE_OBJS) $(SH_OBJS)
152 static_modules.c: static_modules.c.SH
153 /bin/sh ./static_modules.c.SH $(S_OBJS)
155 libmodules.a: $(S_OBJS) static_modules.o
157 $(AR) cqv $@ $(S_OBJS) static_modules.o
162 @echo "ircd: setting up modular directory structure"
163 -@if test -d $(DESTDIR)$(moduledir)-old; then \
164 rm -rf $(DESTDIR)$(moduledir)-old; \
166 -@if test -d $(DESTDIR)$(moduledir); then \
167 echo "ircd: backing up modules"; \
168 mv $(DESTDIR)$(moduledir) $(DESTDIR)$(moduledir)-old; \
171 @mkdir -p -m 755 $(DESTDIR)$(moduledir)
172 @mkdir -p -m 755 $(DESTDIR)$(automoduledir)
174 install: install_@MOD_TARGET@
176 install_libmodules.a: libmodules.a
179 install_shared_modules: install-mkdirs
180 @echo "ircd: installing modules"
181 @for file in $(SH_CORE_OBJS); do \
182 $(INSTALL_DATA) $$file $(DESTDIR)$(moduledir); \
184 @for file in $(SH_OBJS); do \
185 $(INSTALL_DATA) $$file $(DESTDIR)$(automoduledir); \
188 install_hpux_shared: install-mkdirs
189 @echo "ircd: installing modules"
190 @for file in $(HPUX_CORE_OBJS); do \
191 $(INSTALL_DATA) $$file $(DESTDIR)$(moduledir); \
193 @for file in $(HPUX_OBJS); do \
194 $(INSTALL_DATA) $$file $(DESTDIR)$(automoduledir); \
197 .SUFFIXES: .sl .so .o
200 ${CC} ${CPPFLAGS} ${CFLAGS} -DMODNAME=`basename $< .c`_mheader -c $< -o $@
203 ${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $< -o $@
208 .PHONY: depend clean distclean
211 ${MKDEP} ${CPPFLAGS} ${ALL_SRCS} > .depend
212 @$(SED) -e '${SEDOBJ}' < .depend > .depend.tmp-1
213 @$(SED) -e 's#^m_die\.#core/&#' -e 's#^m_error\.#core/&#' -e 's#^m_join\.#core/&#' -e 's#^m_kick\.#core/&#' -e 's#^m_kill\.#core/&#' -e 's#^m_message\.#core/&#' -e 's#^m_mode\.#core/&#' -e 's#^m_nick\.#core/&#' -e 's#^m_part\.#core/&#' -e 's#^m_quit\.#core/&#' -e 's#^m_server\.#core/&#' -e 's#^m_squit\.#core/&#' .depend.tmp-1 > .depend.tmp
214 @$(MV) -f .depend.tmp .depend
215 @$(RM) -f .depend.tmp-1
218 ${RM} -f *.so *.sl *~ *.o *.a
219 ${RM} -f core/*.so core/*.sl core/*~ core/*.o
222 lint -aacgprxhH ${CPPFLAGS} -DIRCD_PREFIX=\"@prefix@\" $(ALL_SRCS) >../lint.out