From 0d49cdffc21967db66014598965fc61cd4f691a3 Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Wed, 18 Jul 2007 16:14:10 +0000 Subject: [PATCH] XXXProgram rules will trigger installation when 'jam install' is given. Some Translation.jam changes. Moved build used variables to Jamrules. --- Jamrules | 34 ++++++++++++++++++++++++++-------- build/Install.jam | 21 +++++++++++++++------ build/Program.jam | 27 +++++++++++++++++++++++---- build/Translation.jam | 8 ++++---- build/Utils.jam | 13 ++++++------- datas/Jamfile | 8 +++++--- edewm/Jamfile | 6 +++--- eiconman/Jamfile | 4 ++-- eimage/Jamfile | 2 +- evoke/Jamfile | 2 +- 10 files changed, 86 insertions(+), 39 deletions(-) diff --git a/Jamrules b/Jamrules index 554ea50..041e0ba 100644 --- a/Jamrules +++ b/Jamrules @@ -8,25 +8,43 @@ # GNU General Public License version 2 or newer. # See COPYING for details. -XGETTEXT ?= xgettext ; -MSGFMT ?= msgfmt ; -RMDIR ?= rmdir ; +# tools used by jam rules +XGETTEXT ?= xgettext ; +MSGFMT ?= msgfmt ; +RMDIR_UNSFE ?= $(RM) -Rf ; +RMDIR_SAFE ?= rmdir ; +CP ?= cp ; +MV ?= mv ; +MKDIRS ?= "mkdir -p" ; +LINKCMD ?= "ln -s" ; -GLOBALFLAGS ?= -Wall -g3 -D_DEBUG -I$(TOP) ; +# directories where data will be installed +PREFIX ?= "/opt/ede2" ; +EDEBINDIR ?= "$(PREFIX)/bin" ; +EDECONFIGDIR ?= "$(PREFIX)/data/config" ; +EDEICONDIR ?= "$(PREFIX)/data/icons" ; +EDEDESKTOPDIR ?= "$(PREFIX)/data/desktop" ; + +# global flags used to be passed to every target +GLOBALFLAGS ?= -Wall -pedantic -g3 -D_DEBUG -I$(TOP) ; STDLIB ?= -lstdc++ ; +# edelib libraries path +EDELIBINCLUDE ?= -I/opt/ede/include ; +EDELIBLIB ?= -L/opt/ede/lib -ledelib ; + +# fltk libraries path FLTKINCLUDE ?= -I/usr/local/include ; FLTKLIB ?= -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -ldl -lm -lXext -lX11 ; FLTKLIB_NOIMAGES ?= -L/usr/local/lib -lfltk -ldl -lm -lXext -lX11 ; -EDELIBINCLUDE ?= -I/opt/ede/include ; -EDELIBLIB ?= -L/opt/ede/lib -ledelib ; - -# backward +# backward; efltk libraries path EFLTKINCLUDE ?= -I/usr/local/include ; EFLTKLIB ?= -L/usr/local/lib -lefltk_images -lpng -lz -ljpeg -lefltk -lX11 -lXext -lm ; EFLTKLIB_NOIMAGES ?= -L/usr/local/lib -lefltk -lX11 -lXext -lm ; +# by default all flags that jam uses directly are cleared +# here should _not_ be set anything since they are filled per target CCFLAGS = ; C++FLAGS = ; OPTIM = ; diff --git a/build/Install.jam b/build/Install.jam index ac1839d..17f75f3 100644 --- a/build/Install.jam +++ b/build/Install.jam @@ -8,9 +8,9 @@ # GNU General Public License version 2 or newer. # See COPYING for details. -EDEBINDIR = "/home/sanel/xxx/bin" ; -EDEICONDIR = "/home/sanel/xxx/icons" ; -EDEDESKTOPFILES = "/home/sanel/xxx/desktop" ; +#EDEBINDIR = "/home/sanel/xxx/bin" ; +#EDEICONDIR = "/home/sanel/xxx/icons" ; +#EDEDESKTOPFILES = "/home/sanel/xxx/desktop" ; # MakeInstallPrivate [location-dir] : [targets] : [opt-file-mode] : [opt-chown] : [opt-chgrp] ; rule MakeInstallPrivate @@ -86,18 +86,27 @@ rule InstallEdeProgram InstallProgram $(EDEBINDIR) : $(<) ; } -# InstallEdeIcons [targets] ; +# InstallEdeIcons [app-dir:] [targets] ; rule InstallEdeIcons { - InstallData $(EDEICONDIR) : $(<) ; + if $(2) { + InstallData [ FDirName $(EDEICONDIR) $(1) ] : $(2) ; + } else { + InstallData $(EDEICONDIR) : $(1) ; + } } # InstallEdeDesktopFiles [targets] ; rule InstallEdeDesktopFiles { - InstallData $(EDEDESKTOPFILES) : $(<) ; + InstallData $(EDEDESKTOPDIR) : $(<) ; } +# InstallEdeDesktopFiles [targets] ; +rule InstallEdeConfigFiles +{ + InstallData $(EDECONFIGDIR) : $(<) ; +} actions Install1 { diff --git a/build/Program.jam b/build/Program.jam index 7cca51e..45c1a81 100644 --- a/build/Program.jam +++ b/build/Program.jam @@ -45,7 +45,7 @@ rule Program MakeProgramPrivate $(1) : $(2) : $(3) : $(4) ; } -# EdeProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] ; +# EdeProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] : [noinstall] ; # Creates EDE specific programs. They will be linked with EDELIBLIB # and FLTKLIB. If [optinal-libraries] or [optinal-flags] are given, they will be # used too. @@ -59,9 +59,13 @@ rule EdeProgram MakeProgramPrivate $(1) : $(2) : $(3) $(EDELIBLIB) $(FLTKLIB) $(STDLIB) : $(4) $(EDELIBINCLUDE) $(FLTKINCLUDE) ; + + if $(5) != "noinstall" { + InstallEdeProgram $(1) ; + } } -# EfltkProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] ; +# EfltkProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] : [noinstall] ; # Creates programs that will be linked with efltk. If [optinal-libraries] or # [optinal-flags] are given, they will be used too. rule EfltkProgram @@ -74,9 +78,14 @@ rule EfltkProgram MakeProgramPrivate $(1) : $(2) : $(3) $(EFLTKLIB) $(STDLIB) : $(4) $(EFLTKINCLUDE) ; + + # install it where ede binaries resides + if $(5) != "noinstall" { + InstallEdeProgram $(1) ; + } } -# FltkProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] ; +# FltkProgram [target] : [sources] : [optinal-libraries] : [optinal-flags] : [noinstall] ; # Creates programs that will be linked with fltk only. It will use full fltk # dependencies (images). rule FltkProgram @@ -89,9 +98,14 @@ rule FltkProgram MakeProgramPrivate $(1) : $(2) : $(3) $(FLTKLIB) $(STDLIB) : $(4) $(FLTKINCLUDE) ; + + # install it where ede binaries resides + if $(5) != "noinstall" { + InstallEdeProgram $(1) ; + } } -# FltkProgramBare [target] : [sources] : [optinal-libraries] : [optinal-flags] ; +# FltkProgramBare [target] : [sources] : [optinal-libraries] : [optinal-flags] : [noinstall] ; # Creates programs that will be linked with fltk only. No images will be linked in it. rule FltkProgramBare { @@ -103,4 +117,9 @@ rule FltkProgramBare MakeProgramPrivate $(1) : $(2) : $(3) $(FLTKLIB_NOIMAGES) $(STDLIB) : $(4) $(FLTKINCLUDE) ; + + # install it where ede binaries resides + if $(5) != "noinstall" { + InstallEdeProgram $(1) ; + } } diff --git a/build/Translation.jam b/build/Translation.jam index 70474b4..265f14d 100644 --- a/build/Translation.jam +++ b/build/Translation.jam @@ -10,12 +10,12 @@ DEFAULT_POT = "messages.pot" ; -# ExtractStrings [dir-where] : [source] : [output-file] ; +# TranslationStrings [dir-where] : [source] : [output-file] ; # Scans [source] file(s) for translatable strings (usually marked as _("foo")) # and store result in [output-file] in [dir-where] directory. If [dir-where] # does not exists, it will be created. # [output-file] can be omitted; in that case DEFAULT_POT will be used. -rule ExtractStrings +rule TranslationStrings { local strfile ; if $(3) { @@ -58,12 +58,12 @@ rule ExtractStrings CleandirSafe distclean : $(locale_dir) ; } -# MakeTranslation [po-dir] : [file1.po file2.po...] ; +# Translation [po-dir] : [file1.po file2.po...] ; # Compile translated files into binary representation, so they # can be used by programs. [po-dir] is directory name where # to look for translated files (.po) and where will be placed # binary ones (.mo). Second parameter is list of .po files. -rule MakeTranslation +rule Translation { local moext mofile pofile path i ; diff --git a/build/Utils.jam b/build/Utils.jam index 86fe643..be78177 100644 --- a/build/Utils.jam +++ b/build/Utils.jam @@ -9,13 +9,12 @@ # See COPYING for details. -RMDIR_UNSFE ?= $(RM) -Rf ; -#RMDIR_SAFE ?= "rmdir --ignore-fail-on-non-empty" ; -RMDIR_SAFE ?= "rmdir" ; -CP ?= "cp" ; -MV ?= "mv" ; -MKDIRS ?= "mkdir -p" ; -LINKCMD ?= "ln -s" ; +#RMDIR_UNSFE ?= $(RM) -Rf ; +#RMDIR_SAFE ?= "rmdir" ; +#CP ?= "cp" ; +#MV ?= "mv" ; +#MKDIRS ?= "mkdir -p" ; +#LINKCMD ?= "ln -s" ; # Fltk use .cxx extension for C++ files so it must # be registered. This rule is called by jam so final diff --git a/datas/Jamfile b/datas/Jamfile index 3e51157..d86d4a5 100644 --- a/datas/Jamfile +++ b/datas/Jamfile @@ -15,6 +15,8 @@ ICONS16 = [ Wildcard icons-16 : *.png : icons-16 ] ; PLINKS = [ Wildcard programs-links : *.desktop : programs-links ] ; CONFS = [ Wildcard *.conf ] ; -#InstallEdeConfig $(CONFS) ; -#InstallEdeIcons $(ICONS16) $(ICONS48) ; -#InstallEdeDesktopFiles $(PLINKS) ; +InstallEdeIcons icons-16 : $(ICONS16) ; +InstallEdeIcons icons-48 : $(ICONS48) ; + +InstallEdeConfigFiles $(CONFS) ; +InstallEdeDesktopFiles $(PLINKS) ; diff --git a/edewm/Jamfile b/edewm/Jamfile index 55d1bc5..b898509 100644 --- a/edewm/Jamfile +++ b/edewm/Jamfile @@ -13,6 +13,6 @@ SubDir TOP edewm ; SOURCE = [ Wildcard *.cpp ] ; POFILES = [ Wildcard locale : *.po ] ; -EfltkProgram edewm : $(SOURCE) ; -ExtractStrings locale : $(SOURCE) ; -MakeTranslation locale : $(POFILES) ; +EfltkProgram edewm : $(SOURCE) ; +TranslationStrings locale : $(SOURCE) ; +Translation locale : $(POFILES) ; diff --git a/eiconman/Jamfile b/eiconman/Jamfile index 4041adc..6738b14 100644 --- a/eiconman/Jamfile +++ b/eiconman/Jamfile @@ -13,6 +13,6 @@ SubDir TOP eiconman ; SOURCE = eiconman.cpp Utils.cpp Wallpaper.cpp DesktopIcon.cpp NotifyBox.cpp ; EdeProgram eiconman : $(SOURCE) ; -ExtractStrings locale : $(SOURCE) ; +TranslationStrings locale : $(SOURCE) ; -FltkProgram test/notify : test/notify.cpp ; +FltkProgram test/notify : test/notify.cpp : : : noinstall ; diff --git a/eimage/Jamfile b/eimage/Jamfile index a0ea5f2..9ae7725 100644 --- a/eimage/Jamfile +++ b/eimage/Jamfile @@ -11,4 +11,4 @@ SubDir TOP eimage ; FltkProgram eimage : eimage.cpp ; -ExtractStrings locale : eimage.cpp ; +TranslationStrings locale : eimage.cpp ; diff --git a/evoke/Jamfile b/evoke/Jamfile index c51ca87..facf74a 100644 --- a/evoke/Jamfile +++ b/evoke/Jamfile @@ -13,4 +13,4 @@ SubDir TOP evoke ; SOURCE = evoke.cpp EvokeService.cpp Log.cpp ; EdeProgram evoke : $(SOURCE) ; -ExtractStrings locale : $(SOURCE) ; +TranslationStrings locale : $(SOURCE) ;