From a7e3211114d6dfba005547339e34bf4cc9e6d0e5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Aug 2009 14:13:33 +0000 Subject: [PATCH] 2009-08-11 16:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bin.cf % Using := instead of = for 'BIN_NAME'. * config/dir.cf % Using := instead of = for 'comma'. * config/dos/watcom.cf % Using := instead of = for 'DOS4G'. * config/instsh.cf + Showing useful information instead of "! Done" in case of error situations. * config/dir.cf * config/global.cf * config/dos/watcom.cf * config/dos/djgpp.cf * config/win/watcom.cf * config/win/bcc.cf * config/instsh.cf * config/dirsh.cf * config/os2/watcom.cf * config/os2/gcc.cf + Indentation. * Syncing some common comments across files. --- harbour/ChangeLog | 27 ++++++++++++++++++++++++ harbour/config/bin.cf | 6 +++--- harbour/config/dir.cf | 28 ++++++++++++------------- harbour/config/dirsh.cf | 6 +++--- harbour/config/dos/djgpp.cf | 28 ++++++++++++------------- harbour/config/dos/watcom.cf | 30 +++++++++++++-------------- harbour/config/global.cf | 2 +- harbour/config/instsh.cf | 8 ++++---- harbour/config/os2/gcc.cf | 20 ++++++++---------- harbour/config/os2/watcom.cf | 40 +++++++++++++++++------------------- harbour/config/win/bcc.cf | 27 ++++++++++++------------ harbour/config/win/watcom.cf | 30 +++++++++++++-------------- 12 files changed, 137 insertions(+), 115 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 28e2ed3e8a..1ae4b8a947 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,33 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-11 16:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/bin.cf + % Using := instead of = for 'BIN_NAME'. + + * config/dir.cf + % Using := instead of = for 'comma'. + + * config/dos/watcom.cf + % Using := instead of = for 'DOS4G'. + + * config/instsh.cf + + Showing useful information instead of "! Done" in case + of error situations. + + * config/dir.cf + * config/global.cf + * config/dos/watcom.cf + * config/dos/djgpp.cf + * config/win/watcom.cf + * config/win/bcc.cf + * config/instsh.cf + * config/dirsh.cf + * config/os2/watcom.cf + * config/os2/gcc.cf + + Indentation. + * Syncing some common comments across files. + 2009-08-11 15:45 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog + Added [WORKS] to prev entry. diff --git a/harbour/config/bin.cf b/harbour/config/bin.cf index c35f7588a7..31c3b4952b 100644 --- a/harbour/config/bin.cf +++ b/harbour/config/bin.cf @@ -58,17 +58,17 @@ include $(TOP)$(ROOT)config/prg.cf HB_GCMODE := 0 -BIN_NAME = +BIN_NAME := ifneq ($(C_MAIN),) ifeq ($(BIN_NAME),) - BIN_NAME = $(C_MAIN:.c=$(BIN_EXT)) + BIN_NAME := $(C_MAIN:.c=$(BIN_EXT)) endif endif ifneq ($(PRG_MAIN),) ifeq ($(BIN_NAME),) - BIN_NAME = $(PRG_MAIN:.prg=$(BIN_EXT)) + BIN_NAME := $(PRG_MAIN:.prg=$(BIN_EXT)) endif endif diff --git a/harbour/config/dir.cf b/harbour/config/dir.cf index fba12827e4..0e5dc53629 100644 --- a/harbour/config/dir.cf +++ b/harbour/config/dir.cf @@ -25,23 +25,23 @@ endif ifeq ($(DIR_RULE),) -# NOTE: The empty line directly before 'endef' HAVE TO exist! -# It causes that every commands will be separated by LF -define dir_mk -@$(MK) $(MKFLAGS) -C $(dir) $@ + # NOTE: The empty line directly before 'endef' HAVE TO exist! + # It causes that every command will be separated by LF + define dir_mk + @$(MK) $(MKFLAGS) -C $(dir) $@ -endef + endef -DIRS_PURE = $(filter-out {%},$(subst {, {,$(DIRS))) -DIRS_DEP = $(filter-out $(DIRS_PURE),$(DIRS)) -DIRS_MK = $(foreach d, $(DIRS_PURE), $(if $(wildcard $(d)/Makefile),$(d),)) -DIR_RULE = $(foreach dir, $(DIRS_MK), $(dir_mk)) -MULTI_DEPS := yes + DIRS_PURE = $(filter-out {%},$(subst {, {,$(DIRS))) + DIRS_DEP = $(filter-out $(DIRS_PURE),$(DIRS)) + DIRS_MK = $(foreach d, $(DIRS_PURE), $(if $(wildcard $(d)/Makefile),$(d),)) + DIR_RULE = $(foreach dir, $(DIRS_MK), $(dir_mk)) + MULTI_DEPS := yes else -DIRS := $(filter-out {%},$(subst {, {,$(DIRS))) -MULTI_DEPS := no + DIRS := $(filter-out {%},$(subst {, {,$(DIRS))) + MULTI_DEPS := no endif @@ -63,9 +63,9 @@ endif install :: $(DIRS_INST) clean :: $(DIRS_CLEAN) -comma=, +comma := , define dep_rule -$(subst $(comma),$(2) ,$(subst },$(2),$(subst {,$(2)::|,$(1)))) + $(subst $(comma),$(2) ,$(subst },$(2),$(subst {,$(2)::|,$(1)))) endef $(foreach dep, $(DIRS_DEP), $(eval $(call dep_rule,$(dep),.clean))) diff --git a/harbour/config/dirsh.cf b/harbour/config/dirsh.cf index 8bb1af4c0a..aa692228b7 100644 --- a/harbour/config/dirsh.cf +++ b/harbour/config/dirsh.cf @@ -12,7 +12,7 @@ ifeq ($(DIRS),) # Empty directory list else ifeq ($(HB_SHELL),sh) - DIR_RULE =\ + DIR_RULE = \ @for d in $(DIRS); do \ if [ -d "$$d" ]; then \ $(MK) $(MKFLAGS) -C $$d $@; \ @@ -32,9 +32,9 @@ ifeq ($(HB_SHELL),dos) # We have to use script to overcome the DOS limit of max 128 characters # NOTE: The empty line directly before 'endef' HAVE TO exist! -# It causes that every commands will be separated by LF +# It causes that every command will be separated by LF define dir_mk -@$(MK_OS) $(MKFLAGS) -C $(file) $@ + @$(MK_OS) $(MKFLAGS) -C $(file) $@ endef diff --git a/harbour/config/dos/djgpp.cf b/harbour/config/dos/djgpp.cf index 7a58a077b4..2229be177c 100644 --- a/harbour/config/dos/djgpp.cf +++ b/harbour/config/dos/djgpp.cf @@ -41,34 +41,34 @@ LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) LDLIBS += -lm # NOTE: The empty line directly before 'endef' HAVE TO exist! -# It causes that every echo command will be separated by LF +# It causes that every command will be separated by LF define lib_object -@echo. ADDMOD $(file) >> __lib__.tmp + @echo. ADDMOD $(file) >> __lib__.tmp endef # We have to use script to overcome the DOS limit of max 128 characters # in commmand line define create_library -@echo. CREATE $(LIB_DIR)/$@ > __lib__.tmp -$(foreach file,$(^F),$(lib_object)) -@echo. SAVE >> __lib__.tmp -@echo. END >> __lib__.tmp -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) -M < __lib__.tmp + @echo. CREATE $(LIB_DIR)/$@ > __lib__.tmp + $(foreach file,$(^F),$(lib_object)) + @echo. SAVE >> __lib__.tmp + @echo. END >> __lib__.tmp + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) -M < __lib__.tmp endef -# NOTE: The empty line below HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAVE TO exist! define link_file -@echo. $(file) >> __link__.tmp + @echo. $(file) >> __link__.tmp endef define link_exe_file -@echo. $(LDFLAGS) $(HB_USER_LDFLAGS) $(LD_OUT)$(BIN_DIR)/$@ > __link__.tmp -$(foreach file,$(^F),$(link_file)) -$(foreach file,$(LIBPATHS),$(link_file)) -$(foreach file,$(LDLIBS),$(link_file)) --$(LD) @__link__.tmp + @echo. $(LDFLAGS) $(HB_USER_LDFLAGS) $(LD_OUT)$(BIN_DIR)/$@ > __link__.tmp + $(foreach file,$(^F),$(link_file)) + $(foreach file,$(LIBPATHS),$(link_file)) + $(foreach file,$(LDLIBS),$(link_file)) + -$(LD) @__link__.tmp endef AR := ar diff --git a/harbour/config/dos/watcom.cf b/harbour/config/dos/watcom.cf index bde1e4a65b..ad2b5b19e7 100644 --- a/harbour/config/dos/watcom.cf +++ b/harbour/config/dos/watcom.cf @@ -72,24 +72,24 @@ else endif CPPFLAGS = -# Note: The empty line directly before 'endef' HAVE TO exist! -# It causes that the 'echo' command is separated by LF +# NOTE: The empty line directly before 'endef' HAVE TO exist! +# It causes that every command will be separated by LF define link_file -@echo FILE $(file) >> __link__.tmp + @echo FILE $(file) >> __link__.tmp endef -#Note: The empty line directly before 'endef' HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAVE TO exist! define link_lib -@echo LIB $(lib) >> __link__.tmp + @echo LIB $(lib) >> __link__.tmp endef define link_exe_file -@echo $(LDFLAGS) NAME $(BIN_DIR)/$@ > __link__.tmp -$(foreach file,$(^F),$(link_file)) -$(foreach lib,$(LDLIBS),$(link_lib)) --$(LD) @__link__.tmp + @echo $(LDFLAGS) NAME $(BIN_DIR)/$@ > __link__.tmp + $(foreach file,$(^F),$(link_file)) + $(foreach lib,$(LDLIBS),$(link_lib)) + -$(LD) @__link__.tmp endef LD := wlink @@ -108,16 +108,16 @@ LDLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS) -#Note: The empty line below HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAVE TO exist! define lib_object -@echo -+$(file) >> __lib__.tmp + @echo -+$(file) >> __lib__.tmp endef define create_library -@echo $(LIB_DIR)/$@ > __lib__.tmp -$(foreach file,$(^F),$(lib_object)) -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp + @echo $(LIB_DIR)/$@ > __lib__.tmp + $(foreach file,$(^F),$(lib_object)) + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp endef AR := wlib @@ -125,7 +125,7 @@ ARFLAGS := -p=64 -c -n AR_RULE = $(create_library) # disable DOS/4GW Banner -export DOS4G=quiet +export DOS4G := quiet include $(TOP)$(ROOT)config/rules.cf diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 46fcbed7af..ea16d1a15e 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -40,7 +40,7 @@ MAKE_381 := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))) # Don't indent this subroutine define find_in_path -$(strip $(foreach dir,$(subst $(PTHSEP), ,$(PATH)),$(wildcard $(dir)/$(1)$(HB_HOST_BIN_EXT)))) + $(strip $(foreach dir,$(subst $(PTHSEP), ,$(PATH)),$(wildcard $(dir)/$(1)$(HB_HOST_BIN_EXT)))) endef define check_host diff --git a/harbour/config/instsh.cf b/harbour/config/instsh.cf index 95bc3c4488..ae96b1f310 100644 --- a/harbour/config/instsh.cf +++ b/harbour/config/instsh.cf @@ -3,10 +3,10 @@ # ifeq ($(INSTALL_FILES),) # Empty install list - INSTALL_RULE := @echo "! Done" + INSTALL_RULE := @echo "! Nothing to install" else ifeq ($(INSTALL_DIR),) # Empty install dir - INSTALL_RULE := @echo "! Done" + INSTALL_RULE := @echo "! Can't install, install dir isn't set" else ifneq ($(HB_SHELL),sh) @@ -58,7 +58,7 @@ ifeq ($(HB_SHELL),os2) # We have to use script to overcome the max command size limit # NOTE: The empty line directly before 'endef' HAVE TO exist! - # It causes that every commands will be separated by LF + # It causes that every command will be separated by LF define inst_file $(CMDPREF)$(CP) $(file) $(INSTALL_DIR_OS) @@ -77,7 +77,7 @@ ifeq ($(HB_SHELL),dos) # We have to use script to overcome the DOS limit of max 128 characters # NOTE: The empty line directly before 'endef' HAVE TO exist! - # It causes that every commands will be separated by LF + # It causes that every command will be separated by LF define inst_file $(CP) $(file) $(INSTALL_DIR_OS) diff --git a/harbour/config/os2/gcc.cf b/harbour/config/os2/gcc.cf index a8dcdfd002..b4d36a822c 100644 --- a/harbour/config/os2/gcc.cf +++ b/harbour/config/os2/gcc.cf @@ -33,8 +33,6 @@ ifeq ($(HB_BUILD_DEBUG),yes) endif LD := $(HB_CMP) -# NOTE: The ending space after -o is important, please preserve it. -# Now solved with '$(subst x,x, )' expression. LD_OUT := -o$(subst x,x, ) ifeq ($(C_MAIN),) @@ -72,22 +70,22 @@ ifeq ($(C_MAIN),) endif endif -# Note: The empty line directly before 'endef' HAVE TO exist! -# It causes that every echo command will be separated by LF +# NOTE: The empty line directly before 'endef' HAVE TO exist! +# It causes that every command will be separated by LF #define lib_object -#echo ADDMOD $(file) >> __lib__.tmp +# echo ADDMOD $(file) >> __lib__.tmp # #endef # We have to use a script to overcome the AR limit of max 850 characters # in commmand line define create_library -if exist $(subst /,$(DIRSEP),$(LIB_FILE)) $(RM) $(subst /,$(DIRSEP),$(LIB_FILE)) -echo CREATE $(LIB_DIR)/$@ > __lib__.tmp -for %i in ( *$(OBJ_EXT) ) do @echo ADDMOD %i >> __lib__.tmp -echo SAVE >> __lib__.tmp -echo END >> __lib__.tmp -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) -M < __lib__.tmp + if exist $(subst /,$(DIRSEP),$(LIB_FILE)) $(RM) $(subst /,$(DIRSEP),$(LIB_FILE)) + echo CREATE $(LIB_DIR)/$@ > __lib__.tmp + for %i in ( *$(OBJ_EXT) ) do @echo ADDMOD %i >> __lib__.tmp + echo SAVE >> __lib__.tmp + echo END >> __lib__.tmp + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) -M < __lib__.tmp endef # Under OS/2 || isn't a command separator (inside a shell, that is); correct separator is & diff --git a/harbour/config/os2/watcom.cf b/harbour/config/os2/watcom.cf index 69ea07d6cb..31b1d1ca2a 100644 --- a/harbour/config/os2/watcom.cf +++ b/harbour/config/os2/watcom.cf @@ -78,30 +78,28 @@ LDLIBS_COMMA := $(subst $(subst x,x, ),$(comma) ,$(strip $(LDLIBS))) LD_RULE = $(LD) $(LDFLAGS) $(HB_USER_LDFLAGS) NAME $(BIN_DIR)/$@ FILE $(LDFILES_COMMA) $(if $(LDLIBS_COMMA), LIB $(LDLIBS_COMMA),) ifeq ($(HB_SHELL),sh) - -create_library = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(^F),-+$(file)) - + create_library = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(^F),-+$(file)) else -# maximum size of command line in OS2 is limited to 1024 characters -# the trick with divided 'wordlist' is workaround for it: -# -$(if $(wordlist 1,100,$(^F)), echo $(wordlist 1,100,$(addprefix -+,$(^F))) >> __lib__.tmp,) -# -$(if $(wordlist 101,200,$(^F)), echo $(wordlist 101,200,$(addprefix -+,$(^F))) >> __lib__.tmp,) -# -$(if $(wordlist 201,300,$(^F)), echo $(wordlist 301,300,$(addprefix -+,$(^F))) >> __lib__.tmp,) -# anyhow OS2 port# of GNU make 3.81 seems to have bug and GPFs when total -# commands length is too big so for %i in ( *$(OBJ_EXT) ) do ... below is -# ugly workaround for both problems + # maximum size of command line in OS2 is limited to 1024 characters + # the trick with divided 'wordlist' is workaround for it: + # -$(if $(wordlist 1,100,$(^F)), echo $(wordlist 1,100,$(addprefix -+,$(^F))) >> __lib__.tmp,) + # -$(if $(wordlist 101,200,$(^F)), echo $(wordlist 101,200,$(addprefix -+,$(^F))) >> __lib__.tmp,) + # -$(if $(wordlist 201,300,$(^F)), echo $(wordlist 301,300,$(addprefix -+,$(^F))) >> __lib__.tmp,) + # anyhow OS2 port# of GNU make 3.81 seems to have bug and GPFs when total + # commands length is too big so for %i in ( *$(OBJ_EXT) ) do ... below is + # ugly workaround for both problems -ifeq ($(HB_SHELL),nt) -FILE := %%f -else -FILE := %f -endif -define create_library -echo $(LIB_DIR)/$@ > __lib__.tmp -for $(FILE) in ( *$(OBJ_EXT) ) do @echo -+$(FILE) >> __lib__.tmp -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp -endef + ifeq ($(HB_SHELL),nt) + FILE := %%f + else + FILE := %f + endif + define create_library + echo $(LIB_DIR)/$@ > __lib__.tmp + for $(FILE) in ( *$(OBJ_EXT) ) do @echo -+$(FILE) >> __lib__.tmp + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp + endef endif AR := wlib diff --git a/harbour/config/win/bcc.cf b/harbour/config/win/bcc.cf index 283124cb94..df9a749608 100644 --- a/harbour/config/win/bcc.cf +++ b/harbour/config/win/bcc.cf @@ -45,31 +45,30 @@ LDLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)$(LIB_EXT)) LDFLAGS += $(LIBPATHS) -# create library rules AR := tlib.exe ARFLAGS := /P64 ifneq ($(HB_SHELL),sh) -# NOTE: The empty line below HAVE TO exist! -define lib_object -@echo -+$(subst /,\,$(file)) ^& >> __lib__.tmp + # NOTE: The empty line directly before 'endef' HAVE TO exist! + define lib_object + @echo -+$(subst /,\,$(file)) ^& >> __lib__.tmp -endef + endef -define create_library -@if exist __lib__.tmp del __lib__.tmp -$(foreach file,$(^F),$(lib_object)) -@echo -+>> __lib__.tmp -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" @__lib__.tmp -endef + define create_library + @if exist __lib__.tmp del __lib__.tmp + $(foreach file,$(^F),$(lib_object)) + @echo -+>> __lib__.tmp + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" @__lib__.tmp + endef -AR_RULE = $(create_library) + AR_RULE = $(create_library) else # sh -AROBJS = $(foreach file,$(^F),-+$(file)) -AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" $(AROBJS) + AROBJS = $(foreach file,$(^F),-+$(file)) + AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" $(AROBJS) endif diff --git a/harbour/config/win/watcom.cf b/harbour/config/win/watcom.cf index 1393a74bda..f72eb3fa76 100644 --- a/harbour/config/win/watcom.cf +++ b/harbour/config/win/watcom.cf @@ -66,25 +66,25 @@ ifeq ($(CC),wcc386) endif endif -# Note: The empty line directly before 'endef' HAVE TO exist! -# It causes that the 'echo' command is separated by LF +# NOTE: The empty line directly before 'endef' HAVE TO exist! +# It causes that every command will be separated by LF define link_file -@echo FILE $(file) >> __link__.tmp + @echo FILE $(file) >> __link__.tmp endef -#Note: The empty line directly before 'endef' HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAVE TO exist! define link_lib -@echo LIB $(lib) >> __link__.tmp + @echo LIB $(lib) >> __link__.tmp endef define link_exe_file -@echo $(LDFLAGS) NAME $(BIN_DIR)/$@ > __link__.tmp -$(foreach file,$(^F),$(link_file)) -$(foreach lib,$(LDLIBS),$(link_lib)) -@echo LIB ws2_32.lib >> __link__.tmp --$(LD) @__link__.tmp + @echo $(LDFLAGS) NAME $(BIN_DIR)/$@ > __link__.tmp + $(foreach file,$(^F),$(link_file)) + $(foreach lib,$(LDLIBS),$(link_lib)) + @echo LIB ws2_32.lib >> __link__.tmp + -$(LD) @__link__.tmp endef LD := wlink @@ -97,16 +97,16 @@ LDLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS) -# NOTE: The empty line below HAVE TO exist! +# NOTE: The empty line directly before 'endef' HAVE TO exist! define lib_object -@echo -+$(file) >> __lib__.tmp + @echo -+$(file) >> __lib__.tmp endef define create_library -@echo $(LIB_DIR)/$@ > __lib__.tmp -$(foreach file,$(^F),$(lib_object)) -$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp + @echo $(LIB_DIR)/$@ > __lib__.tmp + $(foreach file,$(^F),$(lib_object)) + $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp endef AR := wlib