From: <ma...@us...> - 2003-11-21 09:08:13
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15676/src Modified Files: Makefile Log Message: Imported new and cool coloured compilation system by Bodo Thiesen. Index: Makefile =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile 21 Nov 2003 03:01:32 -0000 1.28 +++ Makefile 21 Nov 2003 09:08:11 -0000 1.29 @@ -1,34 +1,99 @@ -# +++ Configuration settings section +++ +############################################################################### +# This file is part of wxInterface. # +# Copyright (C) 2001 Bodo Thiesen <bo...@gm...> # +# 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 # +############################################################################### + +################################## +# Configuration settings section # +################################## # WXCONFIG should point to your wx-config file (usually at /usr/local/bin) -WXCONFIG = /wx/dynamic/2.4.2/bin/wxgtk-2.4-config +WXCONFIG = wx-config + +## +# Either one of the following must be uncommented, but usually, not both. +# +# If CPP_FLAGS is uncommented, maximum optimization is used and no debugging +# information is generated. Recommended for release builds. +# +# If DEBUG_FLAGS is uncommented, no optimization is done and binary is created +# with debugging information (useful for developers). Debug compilation takes +# significently less time, but produces slower output binary. Recommended for +# developers. +#CPP_FLAGS = -O3 -pipe -I. -c +DEBUG_FLAGS = -pipe -I. -c -Wall -g -ggdb + +## +# Uncomment this line to enable compilation flags showing during compilation. +# This should be turned on when reporting compilation errors, so developers +# can see the exact compiler flags. +#PRINTFLAGS = true + +## +# If you have ccache installed, uncomment the following line to +# speed up repeatitive recompilations. Recommended for developers. +#CCACHE = ccache + +# Only relevant on win32 - Location of windres.exe file +WINDRES = windres.exe + +# Uncomment this on win32 systems, adds resources file to compilation objects. +#RES = wxInterface_private.res + +## +# Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, +# which should only be enabled if you have patched wxWindows with +# flexgridsizer.patch +DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ + +# Output colours. Comment out to disable output colouring. +DEFAULTCOLOR =\33[0;40;37;22m +ACTIONCOLOR =\33[0;40;37;2m +ATTENTIONCOLOR=\33[0;40;31;22m +FAILEDCOLOR = +WARNINGCOLOR =\33[0;40;33;22m +NOTICEGCOLOR =\33[0;40;33;2m +WELLCOLOR =\33[0;40;32;22m +OUTPUTCOLOR =\33[0;40;33;1m +INPUTCOLOR =\33[0;40;34;1m +FLAGCOLOR =\33[0;40;37;1m # Don't modify these - automatically generated from WXCONFIG -CXX = $(shell $(WXCONFIG) --cxx) +CXX = $(CCACHE) $(shell $(WXCONFIG) --cxx) CXX_FLAGS = $(shell $(WXCONFIG) --cxxflags) LIBS = $(shell $(WXCONFIG) --libs) -# Normal CPP flags -CPP_FLAGS = -O2 -pipe -I. -c -Wall - -# Debugging CPP flags -DEBUG_FLAGS = -ggdb -pipe -I. -c -g -ggdb -Wall - -# Only needed on Win32 - Location of windres.exe file -WINDRES = windres.exe +# Filenames for pattern rules. These are used for +# temporary data storage, usually not needed to modify. +PIPENAME = Makefile.pipe +STDERROR = Makefile.stderr # Any extra include directives needed INCLUDE_DIR = /local/include -# Our own defines. Only one of meaning is -D__HAVE_REMOVE_GROWABLE_COL__, -# which should only be enabled if you have patched wxWindows with sizer.patch -DEFINES = -D__HAVE_REMOVE_GROWABLE_COL__ - # Final binary name PROGRAM = wxInterface -# +++ Objects section +++ -# Objects list. If new files are added to source tree, add them here also. +################# +# Objects list. # +################# +# If new files are added to source tree, add them here also. +# OBJECTS = ColorFrameCtrl.o \ DownloadListCtrl.o \ GUISettingsDlg.o \ @@ -53,28 +118,96 @@ UploadListCtrl.o \ wxInterface.o \ wxInterface_wdr.o \ -# wxInterface_private.res -# wxInterface_private.res is needed only on win32 platform. Comment out -# on all other platforms. +# $(RES) \ # File suffixes .SUFFIXES: .o .cpp .rc .res -# +++ Compilation/linking commands section +++ -# Compile commands. To make DEBUG build, add $(DEBUG_FLAGS) flag to this command. +############### +# Compilation # +############### + .cpp.o : - $(CXX) $(CPP_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< +ifndef PRINTFLAGS + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +else + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR) with flags $(FLAGCOLOR)$(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS)$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +endif + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(CXX) $(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS) -o $@ $< 2>$(PIPENAME); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + rm $(PIPENAME) $(STDERROR); \ + false; \ + else \ + if test -s $(STDERROR); then \ + echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + else \ + echo -e "$(WELLCOLOR)ok.$(DEFAULTCOLOR)"; \ + fi; \ + fi + @rm $(PIPENAME) $(STDERROR) + .rc.res: - windres -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) +ifndef PRINTFLAGS + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +else + @echo -e -n "$(ACTIONCOLOR)Compiling $(INPUTCOLOR)$<$(ACTIONCOLOR) to $(OUTPUTCOLOR)$@$(ACTIONCOLOR) with flags $(FLAGCOLOR)$(CPP_FLAGS) $(DEBUG_FLAGS) $(DEFINES) -I$(INCLUDE_DIR) $(CXX_FLAGS)$(ACTIONCOLOR): $(ATTENTIONCOLOR)" +endif + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(WINDRES -i $< -I rc -o $@ -O coff --include-dir=$(INCLUDE_DIR) 2>$(PIPENAME); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + rm $(PIPENAME) $(STDERROR); \ + false; \ + else \ + if test -s $(STDERROR); then \ + echo -e "$(WARNINGCOLOR)ok, but warnings:"; \ + cat $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + else \ + echo -e "$(WELLCOLOR)ok.$(DEFAULTCOLOR)"; \ + fi; \ + fi + @rm $(PIPENAME) $(STDERROR) -# Linking command -$(PROGRAM): $(OBJECTS) - $(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) +$(PROGRAM): $(OBJECTS) + @echo -e -n "$(ACTIONCOLOR)Linking $(INPUTCOLOR)$(OBJECTS)$(ACTIONCOLOR)to $(OUTPUTCOLOR)$@$(ACTIONCOLOR): $(ATTENTIONCOLOR)" + @rm -f $(PIPENAME) $(STDERROR) + @mknod $(PIPENAME) p + @cat $(PIPENAME) > $(STDERROR) & + @if ! $(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS) 2>$(PIPENAME) || \ + test -s $(STDERROR); then \ + echo -e "$(FAILEDCOLOR)failed:"; \ + cat $(STDERROR); \ + rm $(PIPENAME) $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + false; \ + else \ + echo -e "$(WELLCOLOR)ok."; \ + rm $(PIPENAME) $(STDERROR); \ + echo -e -n "$(DEFAULTCOLOR)"; \ + echo -e -n "$(WELLCOLOR)Successfully compiled "; \ + echo -e -n "$(WARNINGCOLOR)$(BUILD)"; \ + echo -e -n "$(OUTPUTCOLOR)$@$(WELLCOLOR) binary!\n"; \ + echo -e "$(DEFAULTCOLOR)Now type $(OUTPUTCOLOR)./$@$(DEFAULTCOLOR) to start the application."; \ + fi -# +++ Building section +++ # All builds program with default settings. all: $(PROGRAM) +debug: $(PROGRAM_DEBUG) + # Cleanup command clean: - rm -f $(OBJECTS) $(PROGRAM) + @echo -e -n "Cleaning up..." + @rm -f $(OBJECTS) $(PROGRAM) + @echo -e "$(WELLCOLOR) ok.$(DEFAULTCOLOR)" |