From: <ma...@us...> - 2004-02-19 01:11:14
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25831/src Modified Files: Makefile.am Added Files: functions Log Message: Nicer compile-time output. --- NEW FILE: functions --- #!/bin/sh ################################################################################ # This file is part of wxInterface. # # Copyright (C) 2003 Alo Sarv <ma...@us...> # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ################################################################################ # Get a sane screen width [ -z "${COLUMNS:-}" ] && COLUMNS=80 # Get console type [ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="`/sbin/consoletype`" # Set some variables RES_COL=60 MOVE_TO_COL="echo -en \\033[${RES_COL}G" SETCOLOR_SUCCESS="echo -en \\033[1;32m" SETCOLOR_FAILURE="echo -en \\033[1;31m" SETCOLOR_WARNING="echo -en \\033[1;33m" SETCOLOR_NORMAL="echo -en \\033[0;39m" if [ "$CONSOLETYPE" = "serial" ]; then BOOTUP=serial MOVE_TO_COL= SETCOLOR_SUCCESS= SETCOLOR_FAILURE= SETCOLOR_WARNING= SETCOLOR_NORMAL= fi success() { $MOVE_TO_COL echo -n "[" $SETCOLOR_SUCCESS echo -n " OK " $SETCOLOR_NORMAL echo -e "]\\r\\c" } failure() { $MOVE_TO_COL echo -n "[" $SETCOLOR_FAILURE echo -n "FAILED" $SETCOLOR_NORMAL echo -e "]\\r" } passed() { $MOVE_TO_COL echo -n "[" $SETCOLOR_SUCCESS echo -n "PASSED" $SETCOLOR_NORMAL echo -e "]\\r\\c" } warning() { $MOVE_TO_COL echo -n "[" $SETCOLOR_WARNING echo -n " WARN " $SETCOLOR_NORMAL echo -e "]\\r" } action() { STRING=$1 echo -e "$STRING \\c" shift rm -f .err if ($* 2> .err); then if (test -s .err); then warning "STRING" $SETCOLOR_WARNING cat .err $SETCOLOR_NORMAL else success "STRING" fi else failure "STRING" $SETCOLOR_FAILURE cat .err $SETCOLOR_NORMAL return 1 fi rm -f .err echo } Index: Makefile.am =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile.am,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile.am 14 Jan 2004 13:02:24 -0000 1.16 +++ Makefile.am 19 Feb 2004 01:01:17 -0000 1.17 @@ -31,90 +31,31 @@ all: $(PROGRAM) .c.o: - @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to \\c" - @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR) @PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)\\c" - @if cc @CFLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $< 2>.err; then \ - if test -s .err; then \ - echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ - else \ - echo -e "$(WELLCOLOR)ok.$(ACTIONCOLOR)"; \ - fi; \ - else \ - echo -e "failed:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ + @if . ./functions && ! action "Compiling $<" cc @CFLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $<; then \ false; \ fi; .cpp.o: - @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to \\c" - @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_CPP_FLAGS@: $(ATTENTIONCOLOR)\\c" - @if @CXX@ @CXX_FLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $< 2>.err; then \ - if test -s .err; then \ - echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ - else \ - echo -e "$(WELLCOLOR)ok.$(ACTIONCOLOR)"; \ - fi; \ - else \ - echo -e "failed:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ + @if . ./functions && ! action "Compiling $<" @CXX@ @CXX_FLAGS@ @CPP_FLAGS@ @INCLUDE@ -c -o $@ $<; then \ false; \ fi; @RES@: - @echo -e "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)wxInterface_private.rc$(ACTIONCOLOR) to \\c"; - @echo -e "$(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)\\c"; - @if windres -i wxInterface_private.rc -I rc -o $@ -O coff --include-dir=@RES_INCLUDE@ 2>.err; then \ - if test -s .err; then \ - echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ - else \ - echo -e "$(WELLCOLOR)ok.$(ACTIONCOLOR)"; \ - fi; \ - else \ - echo -e "failed:"; \ - cat .err; \ - rm -f .err; \ - echo -e "$(ACTIONCOLOR)"; \ + @if . ./functions && ! action "Compiling wxInterface_private.rc" windres -i wxInterface_private.rc -I rc -o $@ -O coff --include-dir=@RES_INCLUDE@; then \ false; \ fi; wxInterface: $(WXINTERFACE_OBJECTS) @TRAY_OBJECTS@ - @echo -e "$(ACTIONCOLOR)Linking $(INPUTCOLOR)$(WXINTERFACE_OBJECTS)@TRAY_OBJECTS@ \\c" - @echo -e "$(ACTIONCOLOR)to $(OUTPUTCOLOR)$@$(ACTIONCOLOR)@PRINT_LINK_FLAGS@: \\c" - @echo -e "$(ATTENTIONCOLOR)\\c" - @if @CXX@ -o $(PROGRAM) $(WXINTERFACE_OBJECTS) @TRAY_OBJECTS@ @LIBS@ 2>.err; then \ - echo -e "$(WELLCOLOR)ok."; \ - echo -e "$(ACTIONCOLOR)\\c"; \ - echo -e "$(WELLCOLOR)Successfully compiled \\c"; \ - echo -e "$(WARNINGCOLOR)$(BUILD)\\c"; \ - echo -e "$(OUTPUTCOLOR)$@$(WELLCOLOR) binary!$(ACTIONCOLOR)"; \ - echo -e "$(ACTIONCOLOR)Now cd to src/ dir and type $(OUTPUTCOLOR)./$@$(ACTIONCOLOR) to start the application."; \ - echo -e "$(ACTIONCOLOR)or if you are under Mac OS X, type $(OUTPUTCOLOR)make dist$(ACTIONCOLOR) to build $(OUTPUTCOLOR)$@.app$(DEFAULTCOLOR)"; \ - else \ - echo -e "failed:"; \ - cat .err; \ - echo -e "$(ACTIONCOLOR)"; \ + @if . ./functions && ! action "Linking wxInterface" @CXX@ -o $(PROGRAM) $(WXINTERFACE_OBJECTS) @TRAY_OBJECTS@ @LIBS@; then \ false; \ - fi + fi; clean: - @echo -e "Cleaning up...\\c"; - @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe @TRAY_OBJECTS@; - @echo -e "$(WELLCOLOR) ok.$(ACTIONCOLOR)"; + @if . ./functions && ! action "Cleaning up" rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe @TRAY_OBJECTS@; then \ + false; \ + fi; distclean: - @echo -e "Cleaning up...\\c"; - @rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe Makefile @TRAY_OBJECTS@; - @echo -e "$(WELLCOLOR) ok.$(ACTIONCOLOR)"; + @if . ./functions && ! action "Cleaning up" rm -f $(WXINTERFACE_OBJECTS) $(PROGRAM) $(PROGRAM).exe Makefile src/Makefile @TRAY_OBJECTS@; then \ + false; \ + fi; |