diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 060f8dfebc..b81b9f87a5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-20 20:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/common/watcom.mk + + Readded dos/nt shell specific logic. (they were the same so + far in Harbour, but maybe it'd be now possible to create real + optimize out dos specific hacks for nt shells - unless there + is a chance to break the 8192 bytes nt cmdline length limit.) + + * ChangeLog + + Marked pending items in prev entry. + + * config/dos/watcom.mk + * config/win/watcom.mk + * config/linux/watcom.mk + * config/os2/watcom.mk + % Deleted watcom doc links. It's enough to have them in common file. + 2009-08-20 20:07 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg * config/global.mk @@ -39,10 +55,10 @@ After this change it's possible to create all possible watcom cross-builds. Pls shout if I missed something or the concept seems to have some potential flaws. - ; QUESTION: Does 'wlib' support '-p=64' option on Linux watcom builds? + ; QUESTION: Does 'wlib' support '-p=64' option on Linux watcom builds? [It seems so] ; NOTE: Still most of the not yet merged logic could be merged, since there is only a few minor difference between them. - ; TODO: Add shell optimized watcom rules for nt/dos/sh shells. + ; TODO: Add shell optimized watcom rules for nt/dos/sh shells. [DONE] ; TODO: Try to do a similar stunt for gcc.mk files. * source/pp/ppcore.c diff --git a/harbour/config/common/watcom.mk b/harbour/config/common/watcom.mk index fb8fb31fae..03ab45206a 100644 --- a/harbour/config/common/watcom.mk +++ b/harbour/config/common/watcom.mk @@ -2,7 +2,8 @@ # $Id$ # -# GNU MAKE file for Open Watcom C/C++ compiler +# GNU Make file for Open Watcom C/C++ compiler +# (shell specific rules) # --------------------------------------------------------------- # See option docs here: @@ -35,7 +36,9 @@ LD_RULE = $(LD) $(LDFLAGS) $(HB_USER_LDFLAGS) NAME $(BIN_DIR)/$@$(BIN_EXT) FILE ifeq ($(HB_SHELL),sh) create_library = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(^F),-+$(file)) -else +endif + +ifeq ($(HB_SHELL),os2) # 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,) @@ -58,6 +61,52 @@ else endef endif +ifneq ($(filter $(HB_SHELL),nt dos),) + + # 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 + + endef + + # NOTE: The empty line directly before 'endef' HAVE TO exist! + define link_lib + @$(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 + endef + + LD := wlink + ifeq ($(HB_BUILD_DEBUG),yes) + LDFLAGS += DEBUG ALL + endif + LDFLAGS += SYS nt + + LDLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) + LDLIBS += $(foreach lib,$(SYSLIBS),$(lib)) + + LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS) + + # NOTE: The empty line directly before 'endef' HAVE TO exist! + define lib_object + @$(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 + endef +endif + AR := wlib ARFLAGS := -q -p=64 -c -n AR_RULE = $(create_library) diff --git a/harbour/config/dos/watcom.mk b/harbour/config/dos/watcom.mk index 19c119ca68..e85ccd5303 100644 --- a/harbour/config/dos/watcom.mk +++ b/harbour/config/dos/watcom.mk @@ -2,14 +2,7 @@ # $Id$ # -# GNU MAKE file for Open Watcom C/C++ compiler - -# --------------------------------------------------------------- -# See option docs here: -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/cpopts.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlink.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlib.html -# --------------------------------------------------------------- +# GNU Make file for Open Watcom C/C++ compiler OBJ_EXT := .obj LIB_PREF := diff --git a/harbour/config/linux/watcom.mk b/harbour/config/linux/watcom.mk index 16436a5c7b..59680f4f81 100644 --- a/harbour/config/linux/watcom.mk +++ b/harbour/config/linux/watcom.mk @@ -2,14 +2,7 @@ # $Id$ # -# GNU MAKE file for Open Watcom C/C++ compiler - -# --------------------------------------------------------------- -# See option docs here: -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/cpopts.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlink.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlib.html -# --------------------------------------------------------------- +# GNU Make file for Open Watcom C/C++ compiler OBJ_EXT := .o LIB_PREF := diff --git a/harbour/config/os2/watcom.mk b/harbour/config/os2/watcom.mk index d9fe428daa..75d8b5eca9 100644 --- a/harbour/config/os2/watcom.mk +++ b/harbour/config/os2/watcom.mk @@ -2,14 +2,7 @@ # $Id$ # -# GNU MAKE file for Open Watcom C/C++ compiler - -# --------------------------------------------------------------- -# See option docs here: -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/cpopts.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlink.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlib.html -# --------------------------------------------------------------- +# GNU Make file for Open Watcom C/C++ compiler OBJ_EXT := .obj LIB_PREF := diff --git a/harbour/config/win/watcom.mk b/harbour/config/win/watcom.mk index 849dd3b187..46f3ef9199 100644 --- a/harbour/config/win/watcom.mk +++ b/harbour/config/win/watcom.mk @@ -2,14 +2,7 @@ # $Id$ # -# GNU MAKE file for Open Watcom C/C++ compiler - -# --------------------------------------------------------------- -# See option docs here: -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/cpopts.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlink.html -# http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/compiler-tools/wlib.html -# --------------------------------------------------------------- +# GNU Make file for Open Watcom C/C++ compiler OBJ_EXT := .obj LIB_PREF :=