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 moduledir = @moduledir@
32 # Change this later! -- adrian
33 automoduledir = @moduledir@/autoload
35 INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES)
36 CPPFLAGS = ${INCLUDES} @CPPFLAGS@
118 ALL_SRCS = $(CORE_SRCS) \
121 SH_OBJS = ${SRCS:.c=.so}
122 SH_CORE_OBJS = ${CORE_SRCS:.c=.so}
124 HPUX_OBJS = ${SH_OBJS:.so=.sl}
125 HPUX_CORE_OBJS = ${SH_CORE_OBJS:.so=.sl}
127 S_OBJS = ${ALL_SRCS:.c=.o}
135 shared_modules: $(SH_CORE_OBJS) $(SH_OBJS)
137 hpux_modules: $(HPUX_CORE_OBJS) $(HPUX_OBJS)
139 hpux_shared: $(SH_CORE_OBJS) $(SH_OBJS)
142 static_modules.c: static_modules.c.SH
143 /bin/sh ./static_modules.c.SH $(S_OBJS)
145 libmodules.a: $(S_OBJS) static_modules.o
147 $(AR) cqv $@ $(S_OBJS) static_modules.o
152 @echo "ircd: setting up modular directory structure"
153 -@if test ! -d $(DESTDIR)$(moduledir); then \
154 mkdir $(DESTDIR)$(moduledir); \
156 -@if test -d $(DESTDIR)$(moduledir)-old; then \
157 rm -rf $(DESTDIR)$(moduledir)-old; \
159 -@if test -d $(DESTDIR)$(moduledir); then \
160 echo "ircd: backing up modules"; \
161 mv $(DESTDIR)$(moduledir) $(DESTDIR)$(moduledir)-old; \
164 @mkdir -p -m 755 $(DESTDIR)$(moduledir)
165 @mkdir -p -m 755 $(DESTDIR)$(automoduledir)
167 install: install_@MOD_TARGET@
169 install_libmodules.a: libmodules.a
172 install_shared_modules: install-mkdirs
173 @echo "ircd: installing modules"
174 @for file in $(SH_CORE_OBJS); do \
175 $(INSTALL_DATA) $$file $(DESTDIR)$(moduledir); \
177 @for file in $(SH_OBJS); do \
178 $(INSTALL_DATA) $$file $(DESTDIR)$(automoduledir); \
181 install_hpux_shared: install-mkdirs
182 @echo "ircd: installing modules"
183 @for file in $(HPUX_CORE_OBJS); do \
184 $(INSTALL_DATA) $$file $(DESTDIR)$(moduledir); \
186 @for file in $(HPUX_OBJS); do \
187 $(INSTALL_DATA) $$file $(DESTDIR)$(automoduledir); \
190 .SUFFIXES: .sl .so .o
193 ${CC} ${CPPFLAGS} ${CFLAGS} -DMODNAME=`basename $< .c`_mheader -c $< -o $@
196 ${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@
201 .PHONY: depend clean distclean
204 ${MKDEP} ${CPPFLAGS} ${ALL_SRCS} > .depend
205 @$(SED) -e '${SEDOBJ}' < .depend > .depend.tmp-1
206 @$(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
207 @$(MV) -f .depend.tmp .depend
208 @$(RM) -f .depend.tmp-1
211 ${RM} -f *.so *.sl *~ *.o *.a
212 ${RM} -f core/*.so core/*.sl core/*~ core/*.o
215 lint -aacgprxhH ${CPPFLAGS} -DIRCD_PREFIX=\"@prefix@\" $(ALL_SRCS) >../lint.out