From 33b6330cbb1019a2e23a2ec8ad3adb34a21faabb Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 3 Oct 2013 14:59:01 +0300 Subject: [PATCH] cosmetix in Jambase: use single-quoted string where appropriate --- defaults/Jambase | 4 +- defaults/Jambase.0fixups | 16 ++-- defaults/Jambase.boiler | 4 +- defaults/Jambase.install | 14 ++-- defaults/Jambase.locs | 2 +- defaults/Jambase.object | 12 +-- defaults/Jambase.pkgcfg | 30 +++---- defaults/Jambase.profile | 26 +++--- defaults/Jambase.subdir | 32 ++++---- defaults/Jambase.userext | 4 +- defaults/Jambase.vars | 52 ++++++------ defaults/Jambase.windoze | 12 +-- defaults/build/Jambase.build.genfile | 16 ++-- defaults/configure/Jambase.configure | 118 ++++++++++++++------------- defaults/configure/Jambase.configure.compile | 14 ++-- defaults/configure/Jambase.configure.utils | 16 ++-- defaults/main/Jambase.main | 12 +-- defaults/main/Jambase.main.attrs | 10 +-- defaults/main/Jambase.main.attrs.def | 4 +- defaults/main/Jambase.main.libboth | 10 +-- defaults/main/Jambase.main.libso | 4 +- defaults/misc/Jambase.misc | 45 ++++------ 22 files changed, 222 insertions(+), 235 deletions(-) diff --git a/defaults/Jambase b/defaults/Jambase index 7ddebea..fc1c54b 100644 --- a/defaults/Jambase +++ b/defaults/Jambase @@ -76,7 +76,7 @@ # all - default if none given on command line # -THIS_IS_K8JAM = "tan" ; # we are using k8jam +THIS_IS_K8JAM = 'tan' ; # we are using k8jam . Jambase.0fixups @@ -118,7 +118,7 @@ check-setup-windoze ; # # Now include the user's Jamfile. # -if "gen-boiler" in $(JAM_TARGETS) { +if 'gen-boiler' in $(JAM_TARGETS) { Echo "skipping $(JAMFILE)" ; } else { include $(JAMFILE) ; diff --git a/defaults/Jambase.0fixups b/defaults/Jambase.0fixups index 71844bd..cacd2e7 100644 --- a/defaults/Jambase.0fixups +++ b/defaults/Jambase.0fixups @@ -11,17 +11,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -## if "distclean" in $(JAM_TARGETS) { +## if 'distclean' in $(JAM_TARGETS) { ## __DO_CONFIG_CLEAN__ = tan ; -## JAM_TARGETS -= "distclean" ; -## if ! "clean" in $(JAM_TARGETS) { JAM_TARGETS += "clean" ; } +## JAM_TARGETS -= 'distclean' ; +## if ! 'clean' in $(JAM_TARGETS) { JAM_TARGETS += 'clean' ; } ## } else { ## __DO_CONFIG_CLEAN__ = ; ## } Depends distclean : clean ; -if "config" in $(JAM_TARGETS) || "configure" in $(JAM_TARGETS) { +if 'config' in $(JAM_TARGETS) || 'configure' in $(JAM_TARGETS) { JAM_TARGETS = config ; } @@ -33,7 +33,7 @@ rule --normalize-cleans-- { _pt = ; # prev target _nt = ; # new JAM_TARGETS for _t in $(JAM_TARGETS) { - if $(_t) = "clean" { + if $(_t) = 'clean' { if $(_pt) { # have previous target _nt += $(_pt)_clean ; @@ -52,15 +52,15 @@ rule --normalize-cleans-- { } } if $(_pt) { _nt += $(_pt) ; } - #Echo "new targets:" $(_nt) ; + #Echo 'new targets:' $(_nt) ; JAM_TARGETS = $(_nt) ; } --normalize-cleans-- ; -##Echo "__DO_TARGET_CLEAN__:" "$(__DO_TARGET_CLEAN__)" ; -##if $(__DO_TARGET_CLEAN__) { Echo "**************" ; } +##Echo '__DO_TARGET_CLEAN__:' "$(__DO_TARGET_CLEAN__)" ; +##if $(__DO_TARGET_CLEAN__) { Echo '**************' ; } JAM_SILENT_TARGETS += config diff --git a/defaults/Jambase.boiler b/defaults/Jambase.boiler index 7a629b8..4616a6a 100644 --- a/defaults/Jambase.boiler +++ b/defaults/Jambase.boiler @@ -19,9 +19,9 @@ rule -Generate-Boiler- { NotFile gen-boiler ; Always gen-boiler ; if $(_f) { - _f = "_-boiler-target-force-_" ; + _f = '_-boiler-target-force-_' ; } else { - _f = "_-boiler-target-noforce-_" ; + _f = '_-boiler-target-noforce-_' ; } NotFile $(_f) ; NoCare $(_f) ; diff --git a/defaults/Jambase.install b/defaults/Jambase.install index be67ea7..369ab24 100644 --- a/defaults/Jambase.install +++ b/defaults/Jambase.install @@ -66,12 +66,12 @@ rule InstallDestDir { local spl = [ Split $(<) ] ; # PREFIX ?= /usr/local ; # fix it here, so 'configure' can override it - if $(spl[1]) != "/" { + if $(spl[1]) != '/' { local ppp = [ AddTrailingSlash $(PREFIX) ] ; # if $(ddd) { spl = [ Split $(ppp) ] ; - if $(spl[1]) = "/" { ppp = $(spl[2-]:J) ; } + if $(spl[1]) = '/' { ppp = $(spl[2-]:J) ; } ppp = $(ddd)$(ppp) ; } return $(ppp)$(<); @@ -110,11 +110,11 @@ rule InstallLocate { ## } odir = $(outdir) ; # - ## Echo "InstallLocate:" "$(<)" "|" "$(>)" ; - ## Echo "srcname:" "$(srcname)" ; - ## Echo "srcdir :" "$(srcdir)" ; - ## Echo "outdir :" "$(outdir)" ; - ## Echo "odir :" "$(odir)" ; + ## Echo 'InstallLocate:' "$(<)" '|' "$(>)" ; + ## Echo 'srcname:' "$(srcname)" ; + ## Echo 'srcdir :' "$(srcdir)" ; + ## Echo 'outdir :' "$(outdir)" ; + ## Echo 'odir :' "$(odir)" ; # if $(>) { LOCATE on $(<) = $(>) ; diff --git a/defaults/Jambase.locs b/defaults/Jambase.locs index 1d7a3c8..0fa1970 100644 --- a/defaults/Jambase.locs +++ b/defaults/Jambase.locs @@ -16,7 +16,7 @@ rule set-default-subdir-locates { local bdir ; local d = $(TOP) ; - if ! $(d) { d = "." ; } + if ! $(d) { d = '.' ; } if $(BUILD_DIR) { bdir = [ RemoveTrailingSlashes $(BUILD_DIR) ] ; diff --git a/defaults/Jambase.object b/defaults/Jambase.object index 239b9bf..e14ea36 100644 --- a/defaults/Jambase.object +++ b/defaults/Jambase.object @@ -169,18 +169,18 @@ rule ObjectHdrs { rule Objects { local _i _f _t ; - if ! $(2) || $(2) = "obj" { _t = obj ; } else { _t = $(3)_obj ; } + if ! $(2) || $(2) = 'obj' { _t = obj ; } else { _t = $(3)_obj ; } for _i in [ FGristFiles $(<) ] { - #Echo "Objects:" "$(_i)" "-->" "$(_i:S=$(SUFOBJ))"; - #Echo " $(_t)" ":" "$(_i:S=$(SUFOBJ))" ; + #Echo 'Objects:' "$(_i)" '-->' "$(_i:S=$(SUFOBJ))"; + #Echo " $(_t)" ':' "$(_i:S=$(SUFOBJ))" ; if ! [ Object $(_i:S=$(SUFOBJ)) : $(_i) : $(3) ] { Depends $(_t) : $(_i:S=$(SUFOBJ)) ; - #Echo "DD" $(_t) ":" $(_i:S=$(SUFOBJ)) ; + #Echo 'DD' $(_t) ':' $(_i:S=$(SUFOBJ)) ; } } - if $(_t) != "obj" { - #Echo "$(3)" "depends of" "$(_t)" ; + if $(_t) != 'obj' { + #Echo "$(3)" 'depends of' "$(_t)" ; Depends $(3) : $(_t) ; } } diff --git a/defaults/Jambase.pkgcfg b/defaults/Jambase.pkgcfg index 23b09d4..a913c67 100644 --- a/defaults/Jambase.pkgcfg +++ b/defaults/Jambase.pkgcfg @@ -11,13 +11,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# $(1): check string: "glib-2.0 >= 1.3.4" +# $(1): check string: 'glib-2.0 >= 1.3.4' # return empty string if condition is not met rule pkg-config-exists { local cf res ; cf = [ Command "pkg-config --exists '$(1)' 2>/dev/null" : exit-code code-first ] ; - if $(cf[1]) = "0" { - res = "tan" ; + if $(cf[1]) = '0' { + res = 'tan' ; } else { res = ; } @@ -29,11 +29,11 @@ rule pkg-config-exists { # add output to var $(2) # return resulting (non-empty) string if library is present # if $(2) = "" -- don't add flags, just return -# [ lib-config-ex "pkg-config sdl --cflags" : "CFLAGS" ] +# [ lib-config-ex 'pkg-config sdl --cflags' : 'CFLAGS' ] rule lib-config-ex { local cf lf res ; cf = [ Command "$(1) 2>/dev/null" : parse-output exit-code code-first ] ; - if $(cf[1]) = "0" && $(cf[2]) { + if $(cf[1]) = '0' && $(cf[2]) { res = $(cf[2-]) ; if $(2) { $(2) += $(cf[2-]) ; @@ -47,17 +47,17 @@ rule lib-config-ex { # call $(1) --cflags and $(1) --libs (many libs provides such configurators) # add necessary flags to compiler and linker vars -# return "tan" (non-empty string) if library is present +# return 'tan' (non-empty string) if library is present # if $(2) != "" -- don't add flags, just check -# [ lib-config "pkg-config sdl" ] +# [ lib-config 'pkg-config sdl' ] rule lib-config { local cf lf hasit ; cf = [ Command "$(1) --cflags 2>/dev/null" : parse-output exit-code code-first ] ; - #Echo "cf:" $(cf) ; - if $(cf[1]) = "0" && $(cf[2]) { - hasit = "tan" ; - #Echo "flags:" $(cf[2-]) ; + #Echo 'cf:' $(cf) ; + if $(cf[1]) = '0' && $(cf[2]) { + hasit = 'tan' ; + #Echo 'flags:' $(cf[2-]) ; if ! $(2) { CCFLAGS += $(cf[2-]) ; C++FLAGS += $(cf[2-]) ; @@ -66,10 +66,10 @@ rule lib-config { } lf = [ Command "$(1) --libs 2>/dev/null" : parse-output exit-code code-first ] ; - #Echo "lf:" $(lf) ; - if $(lf[1]) = "0" && $(lf[2]) { - hasit = "tan" ; - #Echo "flags:" $(lf[2-]) ; + #Echo 'lf:' $(lf) ; + if $(lf[1]) = '0' && $(lf[2]) { + hasit = 'tan' ; + #Echo 'flags:' $(lf[2-]) ; if ! $(2) { LINKLIBS += $(lf[2-]) ; C++LINKLIBS += $(lf[2-]) ; diff --git a/defaults/Jambase.profile b/defaults/Jambase.profile index aa40549..042c4be 100644 --- a/defaults/Jambase.profile +++ b/defaults/Jambase.profile @@ -93,7 +93,7 @@ rule --k8jam-profile-standard-- { } -# profile "name" ; +# profile 'name' ; # set compile flags for profile; works only for gcc/g++ # available profiles: # none, default: don't change @@ -104,21 +104,21 @@ rule --k8jam-profile-standard-- { # standard: -O2 rule profile { local pnn = $(1) ; - if ! $(pnn) { pnn = "standard" ; } + if ! $(pnn) { pnn = 'standard' ; } if [ HaveRule --k8jam-profile-$(pnn)-- ] { # --fuck-idiotic-caret-- ; remove-opt-flags-for-all-compilers ; - LINKFLAGS -= "-g" "-s" ; - C++LINKFLAGS -= "-g" "-s" ; - OBJCLINKFLAGS -= "-g" "-s" ; - LINKFLAGS.all -= "-g" "-s" ; + LINKFLAGS -= '-g' '-s' ; + C++LINKFLAGS -= '-g' '-s' ; + OBJCLINKFLAGS -= '-g' '-s' ; + LINKFLAGS.all -= '-g' '-s' ; if ! $(JAM_OPTION_MAKE_UPDATES_SILENT) { Echo "MSG: '$(pnn)' profile" ; } OPT_PROFILE = $(pnn) ; --k8jam-profile-$(OPT_PROFILE)-- ; } else { - Exit "FATAL: invalid profile:" "$(pnn)" ; + Exit 'FATAL: invalid profile:' "$(pnn)" ; } } @@ -130,9 +130,9 @@ rule set-profile { dbg = ; profname = $(PROFILE) ; if ! $(profname) { - if $(DEBUG) { profname = "debug" ; } else { profname = "standard" ; } + if $(DEBUG) { profname = 'debug' ; } else { profname = 'standard' ; } } else { - if $(profname) != "debug" && $(DEBUG) { dbg = "tan" ; } + if $(profname) != 'debug' && $(DEBUG) { dbg = 'tan' ; } } if $(USE_CLANG) { @@ -154,14 +154,14 @@ rule set-profile { profile $(profname) ; if $(VALGRIND) || $(dbg) || $(DEBUG) { - CFLAGS.all -= "-g" "-s" ; - LINKFLAGS.all -= "-g" "-s" ; + CFLAGS.all -= '-g' '-s' ; + LINKFLAGS.all -= '-g' '-s' ; CFLAGS.all += -g ; LINKFLAGS.all += -g ; } if ! $(NO_WARNINGS) { CFLAGS.all += -Wall ; } - if $(NO_NATIVE) { CFLAGS.all -= "-march=native" "-mtune=native" ; } - if $(NO_FWRAP) { CFLAGS.all -= "-fwrapv" ; } + if $(NO_NATIVE) { CFLAGS.all -= '-march=native' '-mtune=native' ; } + if $(NO_FWRAP) { CFLAGS.all -= '-fwrapv' ; } if $(ndb) { DEFINES += $(ndb) ; } diff --git a/defaults/Jambase.subdir b/defaults/Jambase.subdir index 80721ce..53c2c04 100644 --- a/defaults/Jambase.subdir +++ b/defaults/Jambase.subdir @@ -80,7 +80,7 @@ rule SubDir { #local sdr ; # First time through sets up relative root and includes Jamrules. - if ! $(_top) { Exit "SubDir syntax error" ; } + if ! $(_top) { Exit 'SubDir syntax error' ; } if ! $($(_top)-SET) { $(_top)-SET = true ; @@ -140,13 +140,13 @@ rule SubDir { # calls accurately naming the current directory. # Strip common trailing elements of _tokens and SUBDIR_DOWN. - _tokens = [ FReverse $(_tokens) ] ; - SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ; + _tokens = [ ListReverse $(_tokens) ] ; + SUBDIR_DOWN = [ ListReverse $(SUBDIR_DOWN) ] ; FStripCommon _tokens : SUBDIR_DOWN ; - SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ; - _tokens = [ FReverse $(_tokens) ] ; + SUBDIR_DOWN = [ ListReverse $(SUBDIR_DOWN) ] ; + _tokens = [ ListReverse $(_tokens) ] ; - if $(SUBDIR_DOWN) && $(_tokens) { Echo "Warning:" SubDir $(<) "misplaced!" ; } + if $(SUBDIR_DOWN) && $(_tokens) { Echo 'Warning:' SubDir $(<) 'misplaced!' ; } # We'll remember the relative (UP/DOWN) path that # got us here, plus any hard ROOT starting point @@ -193,7 +193,7 @@ rule SubDir { # subsequently be redefined. SEARCH_SOURCE = $(SUBDIR) ; - #if $(SUBDIR) = "." { sdr = "" ; } else { sdr = "$(PATH_SEPARATOR)$(SUBDIR)" ; } + #if $(SUBDIR) = '.' { sdr = "" ; } else { sdr = "$(PATH_SEPARATOR)$(SUBDIR)" ; } if $(ALL_LOCATE_TARGET) { LOCATE_TARGET = "$(ALL_LOCATE_TARGET)$(_xpath)" ; @@ -285,9 +285,9 @@ rule SubIncludeMany { # We use SubDir to get there, in case the included Jamfile # either doesn't have its own SubDir (naughty) or is a subtree # with its own TOP. - #Echo "including " $(<) " : " $(>) ; + #Echo 'including ' $(<) ':' $(>) ; - if ! $($(<[1])) { Exit "SubIncludeMany" $(<[1]) "without prior SubDir" $(<[1]) ; } + if ! $($(<[1])) { Exit 'SubIncludeMany' $(<[1]) 'without prior SubDir' $(<[1]) ; } SubDir $(<) ; include $(JAMFILE:D=$(SUBDIR)) ; } @@ -315,7 +315,7 @@ rule SubInclude { # SubInclude TOP d1 ... ; # # Include a subdirectory's Jamfile. - if ! $($(<[1])) { Exit "SubInclude" $(<[1]) "without prior SubDir" $(<[1]) ; } + if ! $($(<[1])) { Exit 'SubInclude' $(<[1]) 'without prior SubDir' $(<[1]) ; } local _sbiguard = _K8JAM_SUB_GUARD_$(<:J=_) ; SubIncludeOnce $(_sbiguard) : $(<) ; } @@ -326,7 +326,7 @@ rule SubRules { # # Read another tree's Jamrules, by giving it's path according # to this tree and it's own name. - if ! $($(<[1])) { Exit "SubRules" $(<[1]) "without prior SubDir" $(<[1]) ; } + if ! $($(<[1])) { Exit 'SubRules' $(<[1]) 'without prior SubDir' $(<[1]) ; } SubDir $(<) ; SubDir $(>) ; } @@ -353,11 +353,11 @@ rule MakeLocate { } else { odir = $(outdir) ; } - #Echo "MakeLocate:" "$(<)" "|" "$(>)" ; - #Echo "srcname:" "$(srcname)" ; - #Echo "srcdir :" "$(srcdir)" ; - #Echo "outdir :" "$(outdir)" ; - #Echo "odir :" "$(odir)" ; + #Echo 'MakeLocate:' "$(<)" '|' "$(>)" ; + #Echo 'srcname:' "$(srcname)" ; + #Echo 'srcdir :' "$(srcdir)" ; + #Echo 'outdir :' "$(outdir)" ; + #Echo 'odir :' "$(odir)" ; if $(>) { LOCATE on $(<) = $(>) ; Depends $(<) : $(odir) ; diff --git a/defaults/Jambase.userext b/defaults/Jambase.userext index 3405edd..cbeca12 100644 --- a/defaults/Jambase.userext +++ b/defaults/Jambase.userext @@ -29,7 +29,7 @@ rule RegisterUserObjectRule { local nl = $(1) ; nl += $(-user-object-chain-) ; -user-object-chain- = $(nl) ; - #Echo "chain:" [ ListLength $(-user-object-chain-) ] ":" $(-user-object-chain-) ; + #Echo 'chain:' [ ListLength $(-user-object-chain-) ] ':' $(-user-object-chain-) ; } @@ -37,7 +37,7 @@ rule RegisterUserObjectRule { # /UserObject outfile.o : infile.ext : exetarget ; # rule UserObject { - Exit "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ; + Exit 'Unknown suffix on' $(>) '- see UserObject rule in Jamfile(5).' ; } diff --git a/defaults/Jambase.vars b/defaults/Jambase.vars index 696dbcf..6b09d1b 100644 --- a/defaults/Jambase.vars +++ b/defaults/Jambase.vars @@ -31,16 +31,16 @@ if $(NT) { # if $(JAM_TOOLSET) { if ! $(JAM_TOOLSET) in $(SUPPORTED_TOOLSETS) { - Echo "The JAM_TOOLSET environment variable is defined but its value" ; - Echo "is invalid, please use one of the following:" ; + Echo 'The JAM_TOOLSET environment variable is defined but its value' ; + Echo 'is invalid, please use one of the following:' ; Echo ; - for t in $(SUPPORTED_TOOLSETS) { Echo " " $(t) ; } + for t in $(SUPPORTED_TOOLSETS) { Echo ' ' $(t) ; } Exit ; } } if ! $(JAM_TOOLSET) { - Echo "The JAM_TOOLSET environment variable is not defined, defaults to MINGW" ; + Echo 'The JAM_TOOLSET environment variable is not defined, defaults to MINGW' ; JAM_TOOLSET = MINGW ; MINGW ?= 'c:\mingw\bin\' ; } @@ -56,7 +56,7 @@ if $(NT) { SUFLIBSHR ?= .dll ; if $(JAM_TOOLSET) = MINGW { - Echo "Compiler is GCC with MinGW" ; + Echo 'Compiler is GCC with MinGW' ; AR ?= ar -sru ; #RANLIB ?= ranlib ; CC ?= mingw32-gcc ; @@ -72,8 +72,8 @@ if $(NT) { SUFLIB = .a ; SLASH = / ; # MinGW-specific thingy - MINGW_GUI = "-Wl,-subsystem,windows" ; - MINGW_THREADS = "-mthreads" ; + MINGW_GUI = '-Wl,-subsystem,windows' ; + MINGW_THREADS = '-mthreads' ; # k8 C++OPTIM ?= ; C++.standard ?= ; @@ -91,24 +91,24 @@ if $(NT) { if $(RANLIB) { RANLIB = "$(MINGW)$(RANLIB:J= )" ; } } } else if $(JAM_TOOLSET) = LCC { - Echo "Compiler is Win32-LCC" ; + Echo 'Compiler is Win32-LCC' ; AR ?= lcclib ; CC ?= lcc ; CCFLAGS ?= "" ; - C++ ?= "error" ; + C++ ?= 'error' ; LINK ?= lcclnk ; LINKFLAGS ?= "" ; LINKLIBS ?= "" ; OPTIM ?= ; NOARSCAN = true ; # k8 - C++LINK = "error" ; + C++LINK = 'error' ; } else if $(JAM_TOOLSET) = PELLESC { - Echo "Compiler is PellesC" ; + Echo 'Compiler is PellesC' ; AR ?= polib ; CC ?= pocc ; CCFLAGS ?= "" ; - C++ ?= "error" ; + C++ ?= 'error' ; LINK ?= polink ; LINKFLAGS ?= ; LINKLIBS ?= ; @@ -116,7 +116,7 @@ if $(NT) { NOARSCAN = true ; LINKLIBS ?= crt.lib oldnames.lib 'Win\kernel32.lib' ; # k8 - C++LINK = "error" ; + C++LINK = 'error' ; } else { # XXX: We need better comments here !! Exit "On NT, set MINGW to the root of the MinGW dir (but it won't help you anyway)" ; @@ -128,7 +128,7 @@ if $(NT) { # UNIX ############################################################################### else if $(UNIX) { - PATH_SEPARATOR = "/" ; + PATH_SEPARATOR = '/' ; switch $(OS) { case CYGWIN : CC ?= gcc ; @@ -157,7 +157,7 @@ else if $(UNIX) { CC.standard ?= -std=gnu99 ; C++OPTIM ?= ; C++.standard ?= ; - if $(OS) != "LINUX" { RANLIB ?= ranlib ; } + if $(OS) != 'LINUX' { RANLIB ?= ranlib ; } YACC ?= bison ; YACCGEN ?= .c ; YACCFILES ?= y.tab ; @@ -180,8 +180,8 @@ SUFLIBSHR ?= $(SUFLIB) ; # # General defaults; a lot like UNIX # -PATH_SEPARATOR ?= "/" ; -if $(OS) != "LINUX" { AR ?= ar ru ; } else { AR ?= ar sru ; } +PATH_SEPARATOR ?= '/' ; +if $(OS) != 'LINUX' { AR ?= ar ru ; } else { AR ?= ar sru ; } AS ?= as ; ASFLAGS ?= ; AWK ?= awk ; @@ -192,8 +192,6 @@ CC ?= gcc ; # k8: was cc CCFLAGS ?= ; CP ?= cp -f ; #CRELIB ?= ; -DOT ?= . ; -DOTDOT ?= .. ; EXEMODE ?= 755 ; FILEMODE ?= 644 ; HDRS ?= ; @@ -217,7 +215,7 @@ RM ?= rm -f ; RMDIR ?= $(RM) ; RSH ?= rsh ; SED ?= sed ; -SHELLHEADER ?= "#!/bin/sh" ; +SHELLHEADER ?= '#!/bin/sh' ; SHELLMODE ?= 755 ; SLASH ?= / ; SUBDIRRULES ?= ; @@ -225,7 +223,7 @@ SUBDIRRESET ?= ASFLAGS HDRS C++FLAGS CCFLAGS HDRS DEFINES ; SUFEXE ?= "" ; SUFLIB ?= .a ; SUFOBJ ?= .o ; -UNDEFFLAG ?= "-u _" ; +UNDEFFLAG ?= '-u _' ; YACC ?= ; YACCGEN ?= ; YACCFILES ?= ; @@ -248,11 +246,11 @@ OBJCLINKFLAGS ?= $(LINKFLAGS) ; OBJCLINKLIBS ?= $(LINKLIBS) ; OBJCLINKLIBS += -lobjc ; -if $(OS) = "LINUX" { - if ( "gcc" in $(CC) ) && ! ( "-pipe" in $(CC) ) { CC += -pipe ; } - if ( "g++" in $(C++) ) && ! ( "-pipe" in $(C++) ) { C++ += -pipe ; } +if $(OS) = 'LINUX' { + if ( 'gcc' in $(CC) ) && ! ( '-pipe' in $(CC) ) { CC += -pipe ; } + if ( 'g++' in $(C++) ) && ! ( '-pipe' in $(C++) ) { C++ += -pipe ; } } -#Echo "OS:" $(OS) ; -#Echo "OSFULL:" $(OSFULL) ; -#Echo "UNIX:" $(UNIX) ; +#Echo 'OS:' $(OS) ; +#Echo 'OSFULL:' $(OSFULL) ; +#Echo 'UNIX:' $(UNIX) ; diff --git a/defaults/Jambase.windoze b/defaults/Jambase.windoze index f09421b..4a746c3 100644 --- a/defaults/Jambase.windoze +++ b/defaults/Jambase.windoze @@ -31,10 +31,10 @@ rule setup-windoze { SUFLIBSHR = .dll ; #WINDOZE_THREADS = -mthreads ; #WINDOZE_THREADS = ; - WINE ?= "wine" ; + WINE ?= 'wine' ; MGPATH ?= 'c:\\mingw\\bin\\' ; - MGCC ?= "mingw32-gcc.exe -static-libgcc" ; - MG++ ?= "mingw32-g++.exe -static-libgcc -static-libstdc++" ; + MGCC ?= 'mingw32-gcc.exe -static-libgcc' ; + MG++ ?= 'mingw32-g++.exe -static-libgcc -static-libstdc++' ; CC = "$(WINE)" $(MGPATH)$(MGCC) ; LINK = "$(WINE)" $(MGPATH)$(MGCC) -Wl,--enable-auto-import ; AR = "$(WINE)" $(MGPATH)ar.exe -sru ; @@ -45,8 +45,8 @@ rule setup-windoze { #LINKLIBS += -luser32 ; #LINKLIBS += -ladvapi32 ; #LINKLIBS += -lws2_32 ; - #WINSUBSYS = "windows" ; - #WINSUBSYS = "console" ; + #WINSUBSYS = 'windows' ; + #WINSUBSYS = 'console' ; SUFEXE = .exe ; #LINKFLAGS += "-Wl,-subsystem,$(WINSUBSYS)" ; } @@ -85,7 +85,7 @@ rule windoze-fix { CC++ += -mthreads ; } local ss = $(WINSUBSYS) ; - if ! $(ss) { ss = "console" ; } + if ! $(ss) { ss = 'console' ; } LINK += "-Wl,-subsystem,$(ss)" ; C++LINK += "-Wl,-subsystem,$(ss)" ; if $(WINLIBS) { LINKLIBS += $(WINLIBS) ; } else { LINKLIBS += -lkernel32 ; } diff --git a/defaults/build/Jambase.build.genfile b/defaults/build/Jambase.build.genfile index 293f1b6..8fa9420 100644 --- a/defaults/build/Jambase.build.genfile +++ b/defaults/build/Jambase.build.genfile @@ -22,14 +22,14 @@ # if 'image' starts with ':', this is standalone file, don't append any suffix to it. # rule GenFile { - ### Echo "my GenFile!" ; - ### Echo " <" $(<) ; - ### Echo " >" $(>) ; - ### Echo " exe:" $(>[1]) ; + ### Echo 'my GenFile!' ; + ### Echo ' <' $(<) ; + ### Echo ' >' $(>) ; + ### Echo ' exe:' $(>[1]) ; local _exe = [ Match '^:(.+)$' : $(>[1]) ] ; if ! $(_exe) { _exe = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ; } else { _exe = $(_exe[1]) ; } local _t = [ FGristFiles $(<) ] ; - ### Echo $(_t) "depends on" $(_exe) $(3) ; + ### Echo $(_t) 'depends on' $(_exe) $(3) ; Depends $(_t) : $(_exe) $(3) ; local target_rule = GenFile1 ; local sl = ; @@ -52,15 +52,15 @@ rule GenFile { Depends $(_t) : $(s) ; } } else { - ### Echo "option skipped:" $(s) ; + ### Echo 'option skipped:' $(s) ; sl += $(s) ; NoCare $(s) ; NotFile $(s) ; } } #Depends $(_t) : $(_exe) $(>[2-]) ; - ### Echo " _t:" $(_t) ; - ### Echo " sl:" $(sl) ; + ### Echo ' _t:' $(_t) ; + ### Echo ' sl:' $(sl) ; $(target_rule) $(_t) : $(_exe) $(sl) ; Clean clean : $(_t) ; } diff --git a/defaults/configure/Jambase.configure b/defaults/configure/Jambase.configure index 8f87459..92a1ec6 100644 --- a/defaults/configure/Jambase.configure +++ b/defaults/configure/Jambase.configure @@ -29,14 +29,14 @@ # $(2): option arg (if any) rule -configure-show-default-help- { if $(PROJECT_NAME) { - Echo "jam configure for package `" $(PROJECT_NAME) "' supports:" : -S ; + Echo 'jam configure for package `' $(PROJECT_NAME) ''' supports:' : -S ; } else { - Echo "jam configure supports:" ; + Echo 'jam configure supports:' ; } - Echo "common options:" ; - Echo " --prefix=dir install prefix: [/usr/local]" ; + Echo 'common options:' ; + Echo ' --prefix=dir install prefix: [/usr/local]' ; if $(-configure-enable-disable-vars-) { - Echo "package options:" ; + Echo 'package options:' ; -configure-show-enable-disable-help- ; } if [ HaveRule -configure-user-help- ] { -configure-user-help- ; } @@ -51,7 +51,7 @@ rule -configure-options-help- { rule -configure-options-prefix- { if ! $(2) { - Exit "ERROR: --prefix needs argument!" ; + Exit 'ERROR: --prefix needs argument!' ; } -configure-add-line- "PREFIX ?= $(2) ;" ; Echo "MSG: prefix set to $(2)" ; @@ -67,7 +67,7 @@ rule -configure-preinit- { rule -configure-add-line- { local str ; - if $(_CONFIGURE_FATAL_) != "tan" { + if $(_CONFIGURE_FATAL_) != 'tan' { str = "$(1:J= )" ; Depends config : $(str) ; -Action-Configure-WriteLine- $(str) ; @@ -84,30 +84,30 @@ rule -configure-add-line- { rule -configure-pkg-config- { local flg lib ex res ; res = ; - if $(_CONFIGURE_FATAL_) != "tan" { + if $(_CONFIGURE_FATAL_) != 'tan' { Echo "checking for $(1) ... " : -n ; ex = [ pkg-config-exists $(2) ] ; if $(ex) { - Echo "found" ; - -configure-add-line- "#" $(1) ; + Echo 'found' ; + -configure-add-line- '#' $(1) ; flg = [ lib-config-ex "pkg-config '$(2)' --cflags" ] ; lib = [ lib-config-ex "pkg-config '$(2)' --libs" ] ; if $(flg) { - -configure-add-line- "CFLAGS.all +=" $(flg) ";" ; + -configure-add-line- 'CFLAGS.all +=' $(flg) ';' ; } if $(lib) { - -configure-add-line- "LINKLIBS.all +=" $(lib) ";" ; + -configure-add-line- 'LINKLIBS.all +=' $(lib) ';' ; } if $(3) { -configure-add-line- $(3) ; } - res = "tan" ; + res = 'tan' ; } else { - Echo "not found" ; + Echo 'not found' ; if $(5) { -configure-fatal- ; Exit $(5) ; } else { if $(4) { - -configure-add-line- "#" $(1) ; + -configure-add-line- '#' $(1) ; -configure-add-line- $(4) ; } } @@ -118,16 +118,16 @@ rule -configure-pkg-config- { # $(1) list of packages: -# "display name" "pkg-config-str" +# 'display name' 'pkg-config-str' # optional: set PROJECT_NAME to project name rule -configure-pkg-config-necessary- { local _dn _t _pn ; _dn = ; _pn = $(PROJECT_NAME) ; - if ! $(_pn) { _pn = "this project" ; } + if ! $(_pn) { _pn = 'this project' ; } for _t in $(1) { if $(_dn) { - -configure-pkg-config- $(_dn) : $(_t) : : : "FATAL: you need" $(_t) "to build" $(_pn) ; + -configure-pkg-config- $(_dn) : $(_t) : : : 'FATAL: you need' $(_t) 'to build' $(_pn) ; _dn = ; } else { _dn = $(_t) ; @@ -140,11 +140,11 @@ rule -configure-pkg-config-necessary- { # $(2): arg to pkg-config # $(3): fail with this message if not present # $(4): flags prefix -# $(5): USE var; if it is set to "0" -- skip this package +# $(5): USE var; if it is set to '0' -- skip this package # return empty list if package is missing, change USE-var value if necessary # # sample: -# -configure-pkg-config-get-flags- "PCRE" : "libpcre" : : "PCRE" : "MYPKG_USE_PCRE" ; +# -configure-pkg-config-get-flags- 'PCRE' : 'libpcre' : : 'PCRE' : 'MYPKG_USE_PCRE' ; # this will write MYPKG_USE_PCRE flag, PCRE_CFLAGS and PCRE_LIBS # if MYPKG_USE_PCRE is empty at the time of call, library will be count as missing rule -configure-pkg-config-get-flags- { @@ -155,29 +155,29 @@ rule -configure-pkg-config-get-flags- { local flagspfx = $(4) ; local usevar = $(5) ; - if $(_CONFIGURE_FATAL_) != "tan" { + if $(_CONFIGURE_FATAL_) != 'tan' { if $(usevar) && ! $($(usevar)) { Echo "checking for $(displibname) ... disabled" ; - -configure-add-line- "$(usevar)" "= ;" ; + -configure-add-line- "$(usevar)" '= ;' ; if $(failmsg) { -configure-fatal- ; Exit $(failmsg) ; } } else { Echo "checking for $(displibname) ... " : -n ; - -configure-add-line- "#" $(displibname) ; + -configure-add-line- '#' $(displibname) ; flg = [ lib-config-ex "pkg-config $(pcargs) --cflags" ] ; lib = [ lib-config-ex "pkg-config $(pcargs) --libs" ] ; if ! $(flg) && ! $(lib) { # no such package - Echo "not found" ; + Echo 'not found' ; if $(failmsg) { -configure-fatal- ; Exit $(failmsg) ; } else { if $(usevar) { $(usevar) = ; - -configure-add-line- "$(usevar)" "= ;" ; + -configure-add-line- "$(usevar)" '= ;' ; } if $(flagspfx) { -configure-add-line- "$(flagspfx)_CFLAGS = ;" ; @@ -185,14 +185,14 @@ rule -configure-pkg-config-get-flags- { } } } else { - Echo "found" ; + Echo 'found' ; if $(usevar) { $(usevar) = tan ; - -configure-add-line- "$(usevar)" "= tan ;" ; + -configure-add-line- "$(usevar)" '= tan ;' ; } if $(flagspfx) { - -configure-add-line- "$(flagspfx)_CFLAGS =" "$(flg)" ";" ; - -configure-add-line- "$(flagspfx)_LIBS =" "$(lib)" ";" ; + -configure-add-line- "$(flagspfx)_CFLAGS =" "$(flg)" ';' ; + -configure-add-line- "$(flagspfx)_LIBS =" "$(lib)" ';' ; } res = tan ; } @@ -212,15 +212,15 @@ rule -configure-pkg-config-get-flags- { rule -configure-detect-library- { local pfx ; - if $(_CONFIGURE_FATAL_) != "tan" { + if $(_CONFIGURE_FATAL_) != 'tan' { Echo "checking for $(1) ... " : -n ; - -configure-add-line- "#" $(1) ; + -configure-add-line- '#' $(1) ; pfx = [ DetectLibrary $(2) : $(3) : $(4) : $(5) ] ; if $(pfx) { - Echo "found" ; + Echo 'found' ; if $(5) { [ $(5) $(pfx) : $(2) ] ; } } else { - Echo "not found" ; + Echo 'not found' ; if $(6) { [ $(6) $(pfx) : $(2) ] ; } } } @@ -242,7 +242,7 @@ rule -configure-show-enable-disable-help- { if $(help) { # this option is not hidden local len = $(oname:W) ; - if [ ExprI1 $(len) ">" $(maxlen) ] { maxlen = $(len) ; } + if [ ExprI1 $(len) '>' $(maxlen) ] { maxlen = $(len) ; } } } maxlen = [ ExprI1 $(maxlen) + 13 ] ; @@ -259,14 +259,14 @@ rule -configure-show-enable-disable-help- { f = [ ExprI1 $(f) + 1 ] ; if $(help) { # this option is not hidden - if $(val) == "auto" { - help += "(default: autodetect)" ; + if $(val) == 'auto' { + help += '(default: autodetect)' ; ostr = " --disable-$(oname)" ; } else if $(val) { - help += "(default: enabled)" ; + help += '(default: enabled)' ; ostr = " --disable-$(oname)" ; } else { - help += "(default: disabled)" ; + help += '(default: disabled)' ; ostr = " --enable-$(oname)" ; } Echo $(ostr:W=$(maxlen)) $(help) ; @@ -276,10 +276,10 @@ rule -configure-show-enable-disable-help- { # $(1): option name without enable/disable -# $(2): "enable" or "disable" +# $(2): 'enable' or 'disable' rule -configure-do-enable-disable- { if $(-configure-enable-disable-vars-) { - #Echo "option:" $(1) "flag:" $(2) ; + #Echo 'option:' $(1) 'flag:' $(2) ; local f ; f = 1 ; while $(-configure-enable-disable-vars-[$(f)]) { @@ -291,12 +291,12 @@ rule -configure-do-enable-disable- { val = $(-configure-enable-disable-vars-[$(f)]) ; f = [ ExprI1 $(f) + 2 ] ; if $(oname) == $(1) { - if $(2) == "enable" { $(vname) = "tan" ; } else { $(vname) = "" ; } + if $(2) == 'enable' { $(vname) = 'tan' ; } else { $(vname) = "" ; } return ; } } } - Exit "ERROR: unknown option:" "$(ca)" ; + Exit 'ERROR: unknown option:' "$(ca)" ; } @@ -310,7 +310,7 @@ rule -configure-process-enable-disable- { val = $(-configure-enable-disable-vars-[$(f)]) ; f = [ ExprI1 $(f) + 3 ] ; $(vname) = $(val) ; - #Echo "vname:" $(vname) "val:" $(val) "var:" $($(vname)) ; + #Echo 'vname:' $(vname) 'val:' $(val) 'var:' $($(vname)) ; } } @@ -323,7 +323,7 @@ rule -configure-fatal- { rule -configure-main- { local ca nv rln rla rn have_val ; - Echo "configuring..." ; + Echo 'configuring...' ; -Action-Configure-Start- ___start___ ; Depends config : ___start___ ; @@ -331,8 +331,8 @@ rule -configure-main- { CONFIGURE_DONT_PARSE_OPTIONS = ; if $(JAMCONFIGARGS) { - -configure-add-line- "# configure options" ; - -configure-add-line- "#" "$(JAMCONFIGARGS)" ; + -configure-add-line- '# configure options' ; + -configure-add-line- '#' "$(JAMCONFIGARGS)" ; } -configure-add-line- "" ; @@ -345,7 +345,7 @@ rule -configure-main- { if $(nv[1]) { rn = $(nv[1]) ; rla = $(nv[2]) ; - have_val = "tan" ; + have_val = 'tan' ; } else { nv = [ Match '^--(.+)$' : $(ca) ] ; rn = $(nv[1]) ; @@ -361,10 +361,10 @@ rule -configure-main- { if $(nv[2]) { -configure-do-enable-disable- $(nv[2]) : $(nv[1]) ; } else { - Exit "ERROR: unknown option:" "$(ca)" ; + Exit 'ERROR: unknown option:' "$(ca)" ; } } else { - Exit "ERROR: unknown option:" "$(ca)" ; + Exit 'ERROR: unknown option:' "$(ca)" ; } } } @@ -372,8 +372,8 @@ rule -configure-main- { -configure- ; - if $(_CONFIGURE_FATAL_) = "tan" { - Echo "FATAL: configure failed" ; + if $(_CONFIGURE_FATAL_) = 'tan' { + Exit 'FATAL: configure failed' ; } else { Echo "MESSAGE: Now you can run 'jam' to build software." ; } @@ -399,18 +399,22 @@ actions quietly -Action-Configure-WriteLine- { rule configure { local _doit = tan ; + local xtgt = + 'gen-boiler' + clean + distclean + ; K8JAM-CONFIGURE-FILE ?= $(TOP)/Jamrules.auto.configure ; _CONFIGURE_FATAL_ = ona ; Clean distclean : $(K8JAM-CONFIGURE-FILE) ; - if "gen-boiler" in $(JAM_TARGETS) || "clean" in $(JAM_TARGETS) || "distclean" in $(JAM_TARGETS) || $(__DO_TARGET_CLEAN__) { _doit = ; } + if $(xtgt) anyin $(JAM_TARGETS) || $(__DO_TARGET_CLEAN__) { _doit = ; } if $(_doit) { - if ! "config" in $(JAM_TARGETS) { - softinclude $(K8JAM-CONFIGURE-FILE) ; - } + xtgt = config configure ; + if ! ( $(xtgt) anyin $(JAM_TARGETS) ) { softinclude $(K8JAM-CONFIGURE-FILE) ; } # if ! $(_CONFIGURE_COMPLETE_) { JAM_TARGETS = config ; } - if "configure" in $(JAM_TARGETS) { JAM_TARGETS = config ; } - if "config" in $(JAM_TARGETS) { + if 'configure' in $(JAM_TARGETS) { JAM_TARGETS = config ; } + if 'config' in $(JAM_TARGETS) { JAM_OPTION_MAKE_UPDATES_SILENT = tan ; JAM_TARGETS = config ; K8JAM-JOBS = 1 ; diff --git a/defaults/configure/Jambase.configure.compile b/defaults/configure/Jambase.configure.compile index ef06c62..d882610 100644 --- a/defaults/configure/Jambase.configure.compile +++ b/defaults/configure/Jambase.configure.compile @@ -20,12 +20,12 @@ rule -configure-try-compile-cc- { local tfn = [ RandName ] ; tfn = $(tfn:S=.c) ; if [ ListWrite $(tfn) : $(1) ] { - res = [ Command $(CC) -c $(tfn:Q) -o $(tfn:S=.o:Q) $(2) "2>/dev/null" : exit-code no-output ] ; - if $(res) = "0" { - res = [ Command $(LINK) $(tfn:S=.o:Q) -o $(tfn:S=.elf:Q) $(3) "2>/dev/null" : exit-code no-output ] ; + res = [ Command $(CC) -c $(tfn:Q) -o $(tfn:S=.o:Q) $(2) '2>/dev/null' : exit-code no-output ] ; + if $(res) = '0' { + res = [ Command $(LINK) $(tfn:S=.o:Q) -o $(tfn:S=.elf:Q) $(3) '2>/dev/null' : exit-code no-output ] ; } - Command rm $(tfn:Q) $(tfn:S=.o:Q) $(tfn:S=.elf:Q) "2>/dev/null" ; - if $(res) = "0" { res = 1 ; } else { res = ; } + Command rm $(tfn:Q) $(tfn:S=.o:Q) $(tfn:S=.elf:Q) '2>/dev/null' ; + if $(res) = '0' { res = 1 ; } else { res = ; } } } return $(res) ; @@ -38,8 +38,8 @@ rule -configure-try-compile-cc- { # $(4) -- additional linker flags (optional) rule -configure-test-compile-cc- { local r ; - Echo "checking for" $(1) "... " : -n ; + Echo 'checking for' $(1) '... ' : -n ; r = [ -configure-try-compile-cc- $(2) : $(3) : $(4) ] ; - if $(r) { Echo "found" ; } else { Echo "not found" ; } + if $(r) { Echo 'found' ; } else { Echo 'not found' ; } return $(r); } diff --git a/defaults/configure/Jambase.configure.utils b/defaults/configure/Jambase.configure.utils index 0ab3506..de9e0ce 100644 --- a/defaults/configure/Jambase.configure.utils +++ b/defaults/configure/Jambase.configure.utils @@ -23,8 +23,8 @@ rule DetectLibrary { allow-any-header = ; for n in $(4) { - if n == "allow-any-lib" { allow-any-lib = tan ; } - if n == "allow-any-header" { allow-any-header = tan ; } + if n == 'allow-any-lib' { allow-any-lib = tan ; } + if n == 'allow-any-header' { allow-any-header = tan ; } } for n in $(DETECT_LIBRARY_PATH) $(3) { @@ -32,15 +32,15 @@ rule DetectLibrary { if $(allow-any-lib) { havelibs = ; for nn in $(1) { - if [ Command test -e "$(n)/lib/$(nn)" : exit-status status-first no-output ] == "0" { + if [ Command test -e "$(n)/lib/$(nn)" : exit-status status-first no-output ] == '0' { havelibs = tan ; break ; } } } else { - havelibs = "tan" ; + havelibs = 'tan' ; for nn in $(1) { - if [ Command test -e "$(n)/lib/$(nn)" : exit-status status-first no-output ] != "0" { + if [ Command test -e "$(n)/lib/$(nn)" : exit-status status-first no-output ] != '0' { havelibs = ; break ; } @@ -50,15 +50,15 @@ rule DetectLibrary { if $(allow-any-header) { haveh = ; for nn in $(2) { - if [ Command test -e "$(n)/include/$(nn)" : exit-status status-first no-output ] == "0" { + if [ Command test -e "$(n)/include/$(nn)" : exit-status status-first no-output ] == '0' { haveh = tan ; break ; } } } else { - haveh = "tan" ; + haveh = 'tan' ; for nn in $(2) { - if [ Command test -e "$(n)/include/$(nn)" : exit-status status-first no-output ] != "0" { + if [ Command test -e "$(n)/include/$(nn)" : exit-status status-first no-output ] != '0' { haveh = ; break ; } diff --git a/defaults/main/Jambase.main b/defaults/main/Jambase.main index 66a0c10..6ec98a2 100644 --- a/defaults/main/Jambase.main +++ b/defaults/main/Jambase.main @@ -13,11 +13,11 @@ # $(1): image # $(2): target list -# returns "_" for 'selftarget' +# returns '_' for 'selftarget' rule --MainNormalizeTargets-- { local _ctt = $(2) ; if ! $(_ctt) { _ctt = exe ; } - else if $(_ctt) = $(1) { _ctt = "_" ; } + else if $(_ctt) = $(1) { _ctt = '_' ; } return $(_ctt) ; } @@ -44,18 +44,18 @@ rule --MainFromObjects-- { NotFile $(<) ; } - #Echo "MainFromObjects: tgts:" "$(tgts)" "_ctt:" "$(_ctt)" ; + #Echo 'MainFromObjects: tgts:' "$(tgts)" '_ctt:' "$(_ctt)" ; # make compiled sources a dependency of target - if $(_ctt) != "_" { + if $(_ctt) != '_' { for local tgtname in $(_ctt) { - #Echo "separate target:" "$(tgtname)" ; + #Echo 'separate target:' "$(tgtname)" ; Depends $(tgtname) : $(tgts) ; Clean $(tgtname)_clean : $(tgts) ; Depends $(tgtname)_clean : clean ; } } else { - #Echo "separate target:" "$(tgts)" ; + #Echo 'separate target:' "$(tgts)" ; Clean $(tgts)_clean : $(tgts) ; Depends $(tgts)_clean : clean ; } diff --git a/defaults/main/Jambase.main.attrs b/defaults/main/Jambase.main.attrs index c552b6d..68f4e0e 100644 --- a/defaults/main/Jambase.main.attrs +++ b/defaults/main/Jambase.main.attrs @@ -16,7 +16,7 @@ # # flist: list from *Main and so on with changed suffixes (i.e. ready to be gristed) # -# returns file list suitable for Objects rule (gristed) prepended with "have-attrs" flag +# returns file list suitable for Objects rule (gristed) prepended with 'have-attrs' flag # rule --main-preprocess-attrs-- { local have_attrs = "" ; @@ -25,7 +25,7 @@ rule --main-preprocess-attrs-- { # rebuild list removing any attributes for local fname in $(<) { if $(fname) ~= '^![^!]' { - if $(fname:S=) = "!dont-link" { lastfile = ; } else { have_attrs = tan ; } + if $(fname:S=) = '!dont-link' { lastfile = ; } else { have_attrs = tan ; } } else { if $(fname) ~= '^!!' { fname = [ Match '^!([^\s]+)' : $(fname) ] ; @@ -57,12 +57,12 @@ rule --main-postprocess-attrs-- { if $(fm) { if $(lfm) { fm = $(fm[1]); - #Echo "ATTR:" $(fm) "for file:" $(lfm) "ungristed:" $(lfm) ; - if $(fm) != "dont-link" { + #Echo 'ATTR:' $(fm) 'for file:' $(lfm) 'ungristed:' $(lfm) ; + if $(fm) != 'dont-link' { if [ HaveRule --main-option-$(fm)-- ] { --main-option-$(fm)-- [ FGristFiles $(lfm:S=$(SUFOBJ)) ] : $(lfm) ; } else { - Exit "FATAL: invalid attribute" $(fm) "for file" $(lfm) ; + Exit 'FATAL: invalid attribute' $(fm) 'for file' $(lfm) ; } } } diff --git a/defaults/main/Jambase.main.attrs.def b/defaults/main/Jambase.main.attrs.def index 20bc7ca..145f9e6 100644 --- a/defaults/main/Jambase.main.attrs.def +++ b/defaults/main/Jambase.main.attrs.def @@ -15,8 +15,8 @@ # works only for gcc/g++ rule --main-option-no-aliasing-- { if $(OPTIM_NOALIAS) { - #Echo "no-aliasing for" $(<) "ungristed:" $(>) ; - if $(>:S) == ".c" { + #Echo 'no-aliasing for' $(<) 'ungristed:' $(>) ; + if $(>:S) == '.c' { CCFLAGS on $(<) += $(OPTIM_NOALIAS) ; } else { C++FLAGS on $(<) += $(OPTIM_NOALIAS) ; diff --git a/defaults/main/Jambase.main.libboth b/defaults/main/Jambase.main.libboth index 9f8899f..c7498dd 100644 --- a/defaults/main/Jambase.main.libboth +++ b/defaults/main/Jambase.main.libboth @@ -78,17 +78,17 @@ rule BothLibrariesFromObjects { Clean clean : $(tgtd) $(tgta) ; - #Echo "tgtd:" $(tgtd) ; - #Echo "tgta:" $(tgta) ; - #Echo "objlist:" $(objlist) ; + #Echo 'tgtd:' $(tgtd) ; + #Echo 'tgta:' $(tgta) ; + #Echo 'objlist:' $(objlist) ; Archive $(tgta) : $(objlist) ; if $(RANLIB) { Ranlib $(tgta) ; } # creating the library is so much fun on Unix :-) if $(UNIX) { - LINKFLAGS on $(tgtd) += "-shared" ; - C++LINKFLAGS on $(tgtd) += "-shared" ; + LINKFLAGS on $(tgtd) += '-shared' ; + C++LINKFLAGS on $(tgtd) += '-shared' ; LinkUnixLibrary $(tgtd) : $(objlist) ; # in Jambase.link.lib.c } else if $(NT) { local _implib = $(4) ; diff --git a/defaults/main/Jambase.main.libso b/defaults/main/Jambase.main.libso index a285a4d..1db5b11 100644 --- a/defaults/main/Jambase.main.libso +++ b/defaults/main/Jambase.main.libso @@ -82,8 +82,8 @@ rule SharedLibraryFromObjects { # creating the library is so much fun on Unix :-) if $(UNIX) { - LINKFLAGS on $(tgt) += "-shared" ; - C++LINKFLAGS on $(tgt) += "-shared" ; + LINKFLAGS on $(tgt) += '-shared' ; + C++LINKFLAGS on $(tgt) += '-shared' ; LinkUnixLibrary $(tgt) : $(objlist) ; # in Jambase.link.lib.c } else if $(NT) { local _implib = $(4) ; diff --git a/defaults/misc/Jambase.misc b/defaults/misc/Jambase.misc index ccfb75e..9d108e0 100644 --- a/defaults/misc/Jambase.misc +++ b/defaults/misc/Jambase.misc @@ -40,32 +40,24 @@ rule FGristFiles { #rule FGristSourceFiles -rule FReverse { - if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; } -} - - rule FSubDir { # If $(>) is the path to the current directory, compute the # path (using ../../ etc) back to that root directory. # Sets result in $(<) if ! $(<[1]) { - return $(DOT) ; + return '.' ; } else { - local _i _d ; - - _d = $(DOTDOT) ; - for _i in $(<[2-]) { _d = $(_d:R=$(DOTDOT)) ; } + local _d = '..' ; + for local _i in $(<[2-]) { _d = $(_d:R='..') ; } return $(_d) ; } } - +# /FStripCommon v1 : v2 ; +# +# Strip common initial elements of variables v1 and v2. +# Modifies the variable values themselves. rule FStripCommon { - # FStripCommon v1 : v2 ; - - # Strip common initial elements of variables v1 and v2. - # Modifies the variable values themselves. if $($(<)[1]) && $($(<)[1]) = $($(>)[1]) { $(<) = $($(<)[2-]) ; $(>) = $($(>)[2-]) ; @@ -76,19 +68,16 @@ rule FStripCommon { rule FRelPath { local _l _r ; - # first strip off common parts _l = $(<) ; _r = $(>) ; FStripCommon _l : _r ; - # now make path to root and path down _l = [ FSubDir $(_l) ] ; _r = [ FDirName $(_r) ] ; - # Concatenate and save # XXX This should be better - if $(_r) = $(DOT) { return $(_l) ; } else { return $(_r:R=$(_l)) ; } + if $(_r) = '.' { return $(_l) ; } else { return $(_r:R=$(_l)) ; } } @@ -97,9 +86,8 @@ rule FAppendSuffix { # returns (yacc,lex,foo.bat) on Unix and # (yacc.exe,lex.exe,foo.bat) on NT. if $(>) { - local _i _o ; - - for _i in $(<) { + local _o = ; + for local _i in $(<) { if $(_i:S) { _o += $(_i) ; } else { _o += $(_i:S=$(>)) ; } } return $(_o) ; @@ -114,16 +102,13 @@ rule FAppendSuffix { # First, the (generic) UNIX versions # -rule FQuote { return '\"$(<)\"' ; } rule FDefines { return -D$(<) ; } rule FIncludes { return -I$(<) ; } rule FDirName { # Turn individual elements in $(<) into a usable path. - local _i ; - local _s = $(DOT) ; - - for _i in $(<) { _s = $(_i:R=$(_s)) ; } + local _s = '.' ; + for local _i in $(<) { _s = $(_i:R=$(_s)) ; } return $(_s) ; } @@ -138,7 +123,7 @@ rule sys-have-command { if [ Command "which $(1:Q) 2>/dev/null 1>&2" ] { return ; } else { - return "tan" ; + return 'tan' ; } } @@ -149,13 +134,13 @@ rule Undefines { rule IsGCC { - if ( "gcc" in $(CC) ) || ( $(JAM_TOOLSET) = MINGW ) { return "tan"; } + if ( 'gcc' in $(CC) ) || ( $(JAM_TOOLSET) = MINGW ) { return 'tan'; } return ; } rule IsG++ { - if ( "gcc" in $(C++) ) || ( $(JAM_TOOLSET) = MINGW ) { return "tan"; } + if ( 'gcc' in $(C++) ) || ( $(JAM_TOOLSET) = MINGW ) { return 'tan'; } return ; } -- 2.11.4.GIT