From df167bf4ac944ad8c679d2b2751fcf94adc8c714 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 10 Feb 2008 17:22:36 +0000 Subject: Now very tidy make output, with pretty colours :p (Unless it errors, then you get the full commandline and error output etc) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8878 e03df62e-2008-0410-955e-edbf42e46eb7 --- .Makefile.inc | 8 ++++---- configure | 28 ++++++++++++++-------------- make/run-cc.pl | 16 +++++++++++++++- src/modes/Makefile | 34 +++++++++++++++++----------------- 4 files changed, 50 insertions(+), 36 deletions(-) diff --git a/.Makefile.inc b/.Makefile.inc index a8c762276..4d8b94855 100644 --- a/.Makefile.inc +++ b/.Makefile.inc @@ -40,11 +40,11 @@ debug: @echo "* experiencing problems. *" @echo "* *" @echo "*************************************" - ${MAKE} -C . 'FLAGS=${DEBUG}' 'NICEFLAGS=${NICEDEBUG}' all + @${MAKE} -C . 'FLAGS=${DEBUG}' 'NICEFLAGS=${NICEDEBUG}' all mods: @echo "Making modules..." - ${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) + @${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) # Make this depend on 'ircd' and 'mods', so its always output last even with -j finishmessage: ircd mods @@ -65,7 +65,7 @@ ircd: @echo "* http://www.inspircd.org/wiki *" @echo "* while you wait for make to run? *" @echo "*************************************" - ${MAKE} -C src DIRNAME="src" $(MAKEARGS) + @${MAKE} -C src DIRNAME="src" $(MAKEARGS) install: all@EXTRA_DIR@ @-install -d -m $(INSTMODE) $(BASE) @@ -85,7 +85,7 @@ install: all@EXTRA_DIR@ @echo "*************************************" module: - ${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) ${name} + @${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) ${name} clean: @echo Cleaning... diff --git a/configure b/configure index 904f1c7f5..2ecfb5771 100755 --- a/configure +++ b/configure @@ -1369,14 +1369,14 @@ EOCHEESE { print FILEHANDLE " m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps - ../../make/run-cc.pl \$(CC) -pipe -I../../include \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp + @../../make/run-cc.pl \$(CC) -pipe -I../../include \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp " } else { print FILEHANDLE " m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps - ../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp + @../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp "; } $install_list = $install_list . " install -m \$(INSTMODE) src/modules/m_$i.so \$(MODPATH)\n"; @@ -1399,9 +1399,9 @@ m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/ch print "Composing Makefile rules for directory \e[1;32m$name\e[0m... (\e[1;32m$mfcount files found\e[0m)\n"; print FILEHANDLE "$name.so: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $mobjs\n"; if ($config{IS_DARWIN} eq "YES") { - print FILEHANDLE " ../../make/run-cc.pl \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) $mliflags -bundle -o $name.so $mobjs\n"; + print FILEHANDLE " @../../make/run-cc.pl \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) $mliflags -bundle -o $name.so $mobjs\n"; } else { - print FILEHANDLE " ../../make/run-cc.pl \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $mobjs\n"; + print FILEHANDLE " @../../make/run-cc.pl \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $mobjs\n"; } print FILEHANDLE "\n$mfrules\n"; closedir(MDIRHANDLE); @@ -1427,7 +1427,7 @@ sub read_module_directory { my $oname = $fname; $oname =~ s/\.cpp$/.o/g; $mfrules = $mfrules . "$reldpath/$oname: $reldpath/$fname ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps\n"; - $mfrules = $mfrules . " ../../make/run-cc.pl \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $reldpath/$oname -c $reldpath/$fname\n\n"; + $mfrules = $mfrules . " @../../make/run-cc.pl \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $reldpath/$oname -c $reldpath/$fname\n\n"; $mobjs = $mobjs . " $reldpath/$oname"; $mfcount++; } @@ -1600,13 +1600,13 @@ sub write_dynamic_makefile if ($config{IS_DARWIN} eq "YES") { $libraryext = "dylib"; - $othercrap = " ../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n ../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " + $othercrap = " @../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n ../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " } else { $libraryext = "so"; $RPATH = "-Wl,--rpath -Wl,$config{LIBRARY_DIR}" unless defined $opt_disablerpath; - $othercrap = " ../make/run-cc.pl \$(CC) -pipe -I../include $RPATH \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; + $othercrap = " @../make/run-cc.pl \$(CC) -pipe -I../include $RPATH \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; } foreach my $cpp (sort keys %filelist) @@ -1679,12 +1679,12 @@ EOM } } print FH $thislib . ": $cpp $deps ". (defined($specialdeps{$cpp}) ? $specialdeps{$cpp} : "") . "\n"; - print FH " ../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $rawcpp\n"; + print FH " @../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $rawcpp\n"; if (exists($extrabuildlines{$cpp})) { print FH " " . $extrabuildlines{$cpp} . "\n"; } - print FH " ../make/run-cc.pl \$(CC) -pipe $libcrap -o " . $thislib . " " . $objs . "\n\n"; + print FH " @../make/run-cc.pl \$(CC) -pipe $libcrap -o " . $thislib . " " . $objs . "\n\n"; } print FH "moo:\n \${MAKE} -C \"commands\" DIRNAME=\"src/commands\" CC=\"\$(CC)\" \$(MAKEARGS)\n\n"; @@ -1713,17 +1713,17 @@ ITEM foreach my $cmd (@cmdlist) { print FH < sub { my ($msg, $where, $type) = @_; @@ -33,6 +35,7 @@ my @msgfilters = ( [ qr/^.* error: / => sub { my ($msg) = @_; + print STDERR "An error occured when executing:\e[37;1m $cc " . join(' ', @ARGV) . "\n"; print STDERR "\e[31;1m$msg\e[0m\n"; } ], ); @@ -41,7 +44,15 @@ my $pid; my ($r_stderr, $w_stderr); -my $cc = shift(@ARGV); +my $name = ""; + +foreach my $n (@ARGV) +{ + if ($n =~ /\.cpp$/) + { + $name = $n; + } +} if (!defined($cc) || $cc eq "") { die "Compiler not specified!\n"; @@ -54,6 +65,9 @@ $pid = fork; die "Cannot fork to start gcc! $!\n" unless defined($pid); if ($pid) { + + print "\t\e[1;32mBUILD:\e[0m\t\t$name\n" unless $name eq ""; + my $fail = 0; # Parent - Close child-side pipes. close $w_stderr; diff --git a/src/modes/Makefile b/src/modes/Makefile index 18c42221d..bab7b1a88 100644 --- a/src/modes/Makefile +++ b/src/modes/Makefile @@ -4,55 +4,55 @@ CXXFLAGS = -I../../include ${FLAGS} all: umode_w.o umode_s.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a umode_w.o: umode_w.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_w.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_w.cpp umode_s.o: umode_s.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_s.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_s.cpp umode_o.o: umode_o.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_o.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_o.cpp umode_n.o: umode_n.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_n.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_n.cpp umode_i.o: umode_i.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_i.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_i.cpp cmode_v.o: cmode_v.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_v.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_v.cpp cmode_t.o: cmode_t.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_t.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_t.cpp cmode_s.o: cmode_s.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_s.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_s.cpp cmode_p.o: cmode_p.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_p.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_p.cpp cmode_o.o: cmode_o.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_o.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_o.cpp cmode_n.o: cmode_n.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_n.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_n.cpp cmode_m.o: cmode_m.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_m.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_m.cpp cmode_l.o: cmode_l.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_l.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_l.cpp cmode_k.o: cmode_k.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_k.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_k.cpp cmode_i.o: cmode_i.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_i.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_i.cpp cmode_h.o: cmode_h.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_h.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_h.cpp cmode_b.o: cmode_b.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - ../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_b.cpp + @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_b.cpp modeclasses.a: umode_w.o umode_s.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o @-rm -rf modeclasses.a -- cgit v1.2.3