Sfoglia il codice sorgente

Merge branch 'maint'

* maint:
  Use -Qunused-arguments to hide -I unused warnings with clang
  Use basename.i and not target.c.i
  Simplify cleanup
  Add .cpp rules
  Use simpler [C ] for output
  Remove cc1plus and just preprocess first into an .i file
  Get rid of gmake-ism ifeq
  Clean should only call clean, not distclean
  Further simply build by removing src/mod/mod.mk
  Remove redundnat depcop, already set in mod.mk
  Simplify build by moving common target rule to build/build.mk
  No need to generate src/mod/mod.mk
  Fix with BSD sed
Bryan Drewery 12 anni fa
parent
commit
5b6b5806d0

+ 0 - 1
.gitignore

@@ -7,7 +7,6 @@
 /build/config.status
 /build/stamp.*
 /build/autotools/src
-/src/mod/mod.mk
 /*.tgz
 /leaf
 /hub

+ 2 - 2
Makefile.in

@@ -12,7 +12,7 @@ VPATH = @srcdir@
 CCDEPMODE = @CCDEPMODE@
 BINEXEC = wraith@EXEEXT@
 
-STATICMAKEFILES = lib/Makefile src/mod/Makefile src/crypto/Makefile src/compat/Makefile src/Makefile Makefile src/mod/mod.mk
+STATICMAKEFILES = lib/Makefile src/mod/Makefile src/crypto/Makefile src/compat/Makefile src/Makefile Makefile
 CONFIGFILES = build/config.cache build/config.log build/config.status src/config.h src/buildinfo.h
 
 DISTROFILES = README LICENSE build doc scripts lib Makefile.in build.sh configure src BSDmakefile
@@ -98,7 +98,7 @@ clean:  cleanutils
 	+@cd src && $(MAKE) clean
 	+@cd src/compat && $(MAKE) clean
 	+@cd src/crypto && $(MAKE) clean
-	+@cd src/mod && $(MAKE) distclean
+	+@cd src/mod && $(MAKE) clean
 	-+@cd lib && $(MAKE) clean
 	@rm -f $(BINEXEC) build/stamp.* *~ src/*~ configure.temp .mangled stamp.*
 	@rm -f src/help.h src/response.h src/responses.h utctime@EXEEXT@ ts@EXEEXT@

+ 2 - 1
build/autotools/Makefile

@@ -19,10 +19,11 @@ autoconf:
 	@echo "Autoconf...."
 	@autoconf
 	@echo "Fixing configure temp paths"
-	@(if ! sed configure \
+	@(if ! sed \
 	  -e 's:config\.log:build/config.log:g' \
 	  -e 's:config\.status:build/config.status:g' \
 	  -e 's:confdefs\.h:build/confdefs.h:g' \
+	  configure \
 	  > ../../configure; then \
 	  echo "FAILED TO FIX configure" >&2; \
           cp configure ../../configure; \

+ 2 - 1
build/autotools/configure.ac

@@ -31,6 +31,7 @@ AC_CACHE_SAVE
 EGG_CHECK_CCWALL
 EGG_CHECK_CCPIPE
 CXX_FLAG_CHECK([CXXFLAGS], [-fcolor-diagnostics], [colordiagnostics])
+CXX_FLAG_CHECK([CXXFLAGS], [-Qunused-arguments], [unusedarguments])
 CXX_FLAG_CHECK([DEBCXXFLAGS], [-fstack-protector-all], [stackprotector])
 
 EGG_CHECK_DEPMODE
@@ -223,7 +224,7 @@ EGG_SUBST_VERSION
 EGG_SUBST_MOD_UPDIR
 DO_DEPS
 
-AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h src/mod/mod.mk])
+AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h])
 AC_OUTPUT
 
 AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])

+ 29 - 0
build/build.mk

@@ -0,0 +1,29 @@
+depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
+
+%.o: %.cpp $(top_srcdir)/src/stringfix
+	@echo -e "[CC]	\033[1m$*\033[0m"
+	trap "rm -f '.deps/$*.Tpo' $*.ii; exit 1" 1 2 3 5 10 13 15; \
+	if [ "$(CCDEPMODE)" = "gcc3" ]; then \
+	  if $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' $(CXXFLAGS) $(CPPFLAGS) -E $< | $(top_srcdir)/src/stringfix > $*.ii; then \
+	    mv '.deps/$*.TPo' '.deps/$*.Po'; \
+	  fi; \
+	else \
+	  libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
+	  $(CXX) $(CXXFLAGS) $(CPPFLAGS) -E $< | $(top_srcdir)/src/stringfix > $*.ii; \
+	fi; \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $*.ii -o $@; \
+	rm -f '.deps/$*.Tpo' $*.ii
+
+%.o: %.c $(top_srcdir)/src/stringfix
+	@echo -e "[C ]	\033[1m$*\033[0m"
+	trap "rm -f '.deps/$*.Tpo' $*.i; exit 1" 1 2 3 5 10 13 15; \
+	if [ "$(CCDEPMODE)" = "gcc3" ]; then \
+	  if $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' $(CXXFLAGS) $(CPPFLAGS) -E $< | $(top_srcdir)/src/stringfix > $*.i; then \
+	    mv '.deps/$*.TPo' '.deps/$*.Po'; \
+	  fi; \
+	else \
+	  libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
+	  $(CXX) $(CXXFLAGS) $(CPPFLAGS) -E $< | $(top_srcdir)/src/stringfix > $*.i; \
+	fi; \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $*.i -o $@; \
+	rm -f '.deps/$*.Tpo' $*.i

+ 0 - 58
build/cc1plus

@@ -1,58 +0,0 @@
-#! /bin/sh
-
-# This file intercepts the pre-processor and runs 'stringfix' on the source file before it is processed.
-# This avoids the need for the old _*.c temp files.
-
-# Only capture pre-processing
-if [ $1 != "-E" -o -z "$STRINGFIX" -o ! -f "$STRINGFIX" ]; then
-  exec $(${COLLECT_GCC} --print-prog-name=cc1plus) "$@"
-fi
-
-
-# Check for '-MD' as this may be the 'depcomp' call
-depcomp=0
-for arg; do
-  case "$arg" in
-    -MD)
-      depcomp=1
-      ;;
-    *)
-      ;;
-  esac
-done
-
-# Only continue if running in depcomp (avoiding a 2nd pass for -dD/-g3)
-if [ $depcomp -eq 0 ]; then
-  exec $(${COLLECT_GCC} --print-prog-name=cc1plus) "$@"
-fi
-
-### Is this a pipe or not? ###
-
-# Determine the last argument
-for i
-do
-  third_last="$third_last $second_last"
-  second_last=$last
-  last=$i
-done
-
-# If the last param is *.ii, there's no pipe
-case $last in
-  *.ii)
-    piping=0
-    ;;
-  *)
-    piping=1
-    ;;
-esac
-
-if [ $piping -eq 1 ]; then
-  exec $(${COLLECT_GCC} --print-prog-name=cc1plus) "$@" | $STRINGFIX
-else
-  gcc_status=$($(${COLLECT_GCC} --print-prog-name=cc1plus) "$@")
-
-  TEMPFILE=`(umask 077 && mktemp -t "ccXXXXXX") 2>/dev/null`
-  $STRINGFIX < $last > $TEMPFILE
-  mv -f $TEMPFILE $last
-  exit $gcc_status
-fi

+ 110 - 28
configure

@@ -3737,6 +3737,63 @@ EOF
   fi
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -Qunused-arguments" >&5
+$as_echo_n "checking whether the compiler understands -Qunused-arguments... " >&6; }
+if ${egg_cv_prog_cc_unusedarguments+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    ac_saved_flags="$CXXFLAGS"
+    CXXFLAGS="-Werror -Qunused-arguments"
+    cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end build/confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  egg_cv_prog_cc_unusedarguments="yes"
+else
+  egg_cv_prog_cc_unusedarguments="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    CXXFLAGS="$ac_saved_flags"
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_unusedarguments" >&5
+$as_echo "$egg_cv_prog_cc_unusedarguments" >&6; }
+
+  if [ "$egg_cv_prog_cc_unusedarguments" = "yes" ]; then
+    CXXFLAGS="$CXXFLAGS -Qunused-arguments"
+  elif [ -n "" ]; then
+      cat << 'EOF' >&2
+configure: error:
+
+  Your OS or C++ compiler does not support -Qunused-arguments.
+  This compile flag is required.
+
+EOF
+    exit 1
+  fi
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fstack-protector-all" >&5
 $as_echo_n "checking whether the compiler understands -fstack-protector-all... " >&6; }
 if ${egg_cv_prog_cc_stackprotector+:} false; then :
@@ -6853,12 +6910,14 @@ $as_echo "#define gid_t int" >>build/confdefs.h
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if ${ac_cv_type_long_long_int+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_cv_type_unsigned_long_long_int=yes
+     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+       cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end build/confdefs.h.  */
 
   /* For now, do not test the preprocessor; as of 2007 there are too many
@@ -6891,37 +6950,64 @@ main ()
 
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-                          if test "$cross_compiling" = yes; then :
+
+else
+  ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>build/confdefs.h
+
+  fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
   ac_cv_type_long_long_int=yes
+      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+        if test $ac_cv_type_long_long_int = yes; then
+                                        if test "$cross_compiling" = yes; then :
+  :
 else
   cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end build/confdefs.h.  */
 #include <limits.h>
-               #ifndef LLONG_MAX
-               # define HALF \
-                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-               # define LLONG_MAX (HALF - 1 + HALF)
-               #endif
+                 #ifndef LLONG_MAX
+                 # define HALF \
+                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+                 # define LLONG_MAX (HALF - 1 + HALF)
+                 #endif
 int
 main ()
 {
 long long int n = 1;
-               int i;
-               for (i = 0; ; i++)
-                 {
-                   long long int m = n << i;
-                   if (m >> i != n)
-                     return 1;
-                   if (LLONG_MAX / 2 < m)
-                     break;
-                 }
-               return 0;
+                 int i;
+                 for (i = 0; ; i++)
+                   {
+                     long long int m = n << i;
+                     if (m >> i != n)
+                       return 1;
+                     if (LLONG_MAX / 2 < m)
+                       break;
+                   }
+                 return 0;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_run "$LINENO"; then :
-  ac_cv_type_long_long_int=yes
+
 else
   ac_cv_type_long_long_int=no
 fi
@@ -6929,11 +7015,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-else
-  ac_cv_type_long_long_int=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+        fi
+      fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
 $as_echo "$ac_cv_type_long_long_int" >&6; }
@@ -8745,7 +8828,7 @@ $as_echo X"$mf" |
 done
 
 
-ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h src/mod/mod.mk"
+ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -9446,7 +9529,6 @@ do
     "src/crypto/Makefile") CONFIG_FILES="$CONFIG_FILES src/crypto/Makefile" ;;
     "src/mod/Makefile") CONFIG_FILES="$CONFIG_FILES src/mod/Makefile" ;;
     "src/buildinfo.h") CONFIG_FILES="$CONFIG_FILES src/buildinfo.h" ;;
-    "src/mod/mod.mk") CONFIG_FILES="$CONFIG_FILES src/mod/mod.mk" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac

+ 1 - 1
src/.gitignore

@@ -1,6 +1,5 @@
 /Makefile
 /buildinfo.h
-/*.c.real
 /_*.c
 /*~
 /help.h
@@ -15,3 +14,4 @@
 /makeset
 /set_default.h
 *.o
+*.i

+ 9 - 22
src/Makefile.in

@@ -10,7 +10,7 @@ VPATH = @srcdir@
 CXXFLAGS = @CXXFLAGS@ -I. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/pack @DEFS@ $(INCLUDES) $(CFLGS) '-DCOMMIT="$(COMMIT)"' '-DBRANCH="$(BRANCH)"' -DBUILDTS=$(BUILDTS) '-DVERSION="$(VERSION)"'
 CPPFLAGS = @CPPFLAGS@
 
-depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
+include $(top_srcdir)/build/build.mk
 
 OBJCOPY = @OBJCOPY@
 
@@ -57,14 +57,14 @@ OBJS = auth.o \
 	userrec.o \
 	users.o
 
-MODOBJS = mod/channels.o \
-        mod/console.o \
-        mod/ctcp.o \
-        mod/irc.o \
-        mod/server.o \
-        mod/share.o \
-        mod/transfer.o \
-        mod/update.o
+MODOBJS = mod/channels.mod/channels.o \
+        mod/console.mod/console.o \
+        mod/ctcp.mod/ctcp.o \
+        mod/irc.mod/irc.o \
+        mod/server.mod/server.o \
+        mod/share.mod/share.o \
+        mod/transfer.mod/transfer.o \
+        mod/update.mod/update.o
 
 
 MAKE_GENERIC = $(MAKE) 'MAKE=$(MAKE)' 'MAKEFLAGS=$(MAKEFLAGS)' 'CXX=$(CXX)' 'LD=$(LD)' 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS)' 'CCDEPMODE=$(CCDEPMODE)'
@@ -129,16 +129,3 @@ mycrypto:
 	+@cd crypto && $(MAKE_GENERIC) crypto
 
 include ./.deps/includes
-
-%.o: %.c stringfix@EXEEXT@ $(top_srcdir)/build/cc1plus
-	@echo -e "Compiling: \033[1m$*\033[0m"
-ifeq ($(CCDEPMODE),gcc3)
-	if STRINGFIX='$(top_srcdir)/$(STRINGFIX)' $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' -DSTRINGFIX=$(STRINGFIX) -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@; then \
-	mv '.deps/$*.TPo' '.deps/$*.Po'; \
-	else rm -f '.deps/$*.Tpo'; exit 1; \
-	fi
-else
-	# STRINGFIX included after CXX for ccache to recognize
-	STRINGFIX="$(top_srcdir)/$(STRINGFIX)" libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CXX) -DSTRINGFIX=$(STRINGFIX) -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
-endif

+ 2 - 13
src/compat/Makefile.in

@@ -4,7 +4,8 @@ SHELL = @SHELL@
 top_srcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
+
+include $(top_srcdir)/build/build.mk
 
 @SET_MAKE@
 
@@ -36,15 +37,3 @@ clean:
 compat: $(OBJS)
 
 include ./.deps/includes
-
-%.o: %.c
-	@echo -e "Compiling: \033[1m$*\033[0m"
-ifeq ($(CCDEPMODE),gcc3)
-	if $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@; then \
-	mv '.deps/$*.TPo' '.deps/$*.Po'; \
-	else rm -f '.deps/$*.Tpo'; exit 1; \
-	fi
-else
-	libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
-endif

+ 4 - 1
src/config.h.in

@@ -84,7 +84,7 @@
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
-/* Define to 1 if the system has the type `long long int'. */
+/* Define to 1 if the system has the type 'long long int'. */
 #undef HAVE_LONG_LONG_INT
 
 /* Define to 1 if `lstat' has the bug that it succeeds when given the
@@ -240,6 +240,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK
 

+ 2 - 14
src/crypto/Makefile.in

@@ -6,9 +6,9 @@ SHELL = @SHELL@
 CXXFLAGS = @CXXFLAGS@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @DEFS@ $(CFLGS)
 CPPFLAGS = @CPPFLAGS@
 STRIP = @STRIP@
-
 VPATH = @srcdir@
-depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
+
+include $(top_srcdir)/build/build.mk
 
 @SET_MAKE@
 
@@ -29,15 +29,3 @@ clean:
 crypto: $(OBJS)
 
 include ./.deps/includes
-
-%.o: %.c
-	@echo -e "Compiling: \033[1m$*\033[0m"
-ifeq ($(CCDEPMODE),gcc3)
-	if $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@; then \
-	mv '.deps/$*.TPo' '.deps/$*.Po'; \
-	else rm -f '.deps/$*.Tpo'; exit 1; \
-	fi
-else
-	libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
-endif

+ 2 - 2
src/mod/Makefile.in

@@ -73,7 +73,7 @@ clean:
 			cp $(srcdir)/$$i/Makefile $$i/Makefile; \
 		fi; \
 		if (test -r $$i/Makefile); then \
-			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' clean); \
+			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" top_srcdir="$(MOD_UPDIR)$(top_srcdir)" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' clean); \
 		fi; \
 	done
 
@@ -86,7 +86,7 @@ distclean:
 			cp $(srcdir)/$$i/Makefile $$i/Makefile; \
 		fi; \
 		if (test -r $$i/Makefile); then \
-			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' distclean); \
+			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" top_srcdir="$(MOD_UPDIR)$(top_srcdir)" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' distclean); \
 		fi; \
 	done
 

+ 2 - 4
src/mod/channels.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/channels.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = channels.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../channels.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/compress.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/compress.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = compress.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../compress.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/console.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/console.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = console.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../console.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/ctcp.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/ctcp.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = ctcp.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../ctcp.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 5
src/mod/irc.mod/Makefile

@@ -1,14 +1,11 @@
 # Makefile for src/mod/irc.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-
-#This line is simply for configure to generate .deps/
 OBJS = irc.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -16,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../irc.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 0 - 14
src/mod/mod.mk.in

@@ -1,14 +0,0 @@
-depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
-
-../%.o: %.c $(top_srcdir)/src/stringfix $(top_srcdir)/build/cc1plus
-	@echo -e "Compiling: \033[1m$*\033[0m"
-ifeq ($(CCDEPMODE),gcc3)
-	if STRINGFIX='$(top_srcdir)/$(STRINGFIX)' $(CXX) -MT '$@' -MD -MP -MF '.deps/$*.TPo' -DSTRINGFIX=$(STRINGFIX) -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@; then \
-	mv '.deps/$*.TPo' '.deps/$*.Po'; \
-	else rm -f '.deps/$*.Tpo'; exit 1; \
-	fi
-else
-	# STRINGFIX included after CXX for ccache to recognize
-	STRINGFIX="$(top_srcdir)/$(STRINGFIX)" libtool=no source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CXX) -DSTRINGFIX=$(STRINGFIX) -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
-endif

+ 2 - 4
src/mod/server.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/server.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = server.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../server.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/share.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/share.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = share.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../share.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/transfer.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/transfer.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = transfer.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../transfer.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~

+ 2 - 4
src/mod/update.mod/Makefile

@@ -1,13 +1,11 @@
 # Makefile for src/mod/update.mod/
 
 srcdir = .
-depcomp = /bin/sh ../../../build/autotools/depcomp
 
-#This line is simply for configure to generate .deps/
 OBJS = update.o
 
 include ./.deps/includes
-include ../mod.mk
+include $(top_srcdir)/build/build.mk
 
 doofus:
 	@echo ""
@@ -15,7 +13,7 @@ doofus:
 	@echo ""
 	@cd ../../../ && make
 
-static: ../update.o
+static: $(OBJS)
 
 clean:
 	@rm -f .depend *.o *~