Files
harbour-core/harbour/config/dos/watcom.mk
Przemyslaw Czerpak bdfb6a9e93 2009-12-21 08:21 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbgtcore.h
  * harbour/include/hbapigt.h
    * moved declaration of hb_gtSetDefault() from hbgtcore.h to hbapigt.h

  * harbour/include/hbapi.h
  * harbour/src/vm/hvm.c
    + added new function hb_vmSetDefaultGT()

  * harbour/bin/hb-func.sh
  * harbour/utils/hbmk2/hbmk2.prg
    * use hb_vmSetDefaultGT() to set default GT
    * removed extern declarations for functions defined in hbapi.h

  * harbour/src/vm/dynlibhb.c
    + added support for HB_LIBLOAD()/HB_LIBFREE() in DJGPP 2.04 builds

  * harbour/config/global.mk
    * use 8.3 names for harbour dynamic libraries in all DOS builds

  * harbour/config/dos/djgpp.mk
    + added support for dynamic libraries (DXE) in DJGPP builds.
      DXE is sth similar to DLL in Windows and can be used with
      DJGPP 2.04. I had to make some modifications in DXE header
      files to make it working so it will not work in default DJGPP
      installation. I'll document these modifications in the future.

  * harbour/config/dos/watcom.mk
    * enable creating of harbour dynamic libraries only when HB_BUILD_DLL
      is explictly set by user to 'yes'. In DOS DJGPP and OpenWatcom builds
      DLLs support is not functional yet.

  * harbour/config/dyn.mk
    * added an option to create harbour dynamic libraries from static
      ones instead of .o|.obj files. It's necessary for DXE3GEN which
      internally calls LD which has some limited on maximum size of passed
      parameters.
      TODO: make HB_DYN_LIBS definition common for dyn.mk and lib.mk
2009-12-21 07:22:14 +00:00

107 lines
2.2 KiB
Makefile

#
# $Id$
#
# GNU Make file for Open Watcom C/C++ compiler
OBJ_EXT := .obj
LIB_PREF :=
LIB_EXT := .lib
DYN_EXT := .dll
ifeq ($(HB_BUILD_MODE),cpp)
CC := wpp386
else
CC := wcc386
endif
CC_IN :=
CC_OUT := -fo=
CFLAGS += -zq -bt=dos
LDFLAGS += OP quiet
ifneq ($(HB_BUILD_WARN),no)
CFLAGS += -w3
else
CFLAGS += -w0
endif
ifneq ($(HB_BUILD_OPTIM),no)
# architecture flags
CFLAGS += -5r -fp5
# optimization flags
# don't enable -ol optimization in OpenWatcom 1.1 - gives buggy code
# -oxaht
CFLAGS += -onaehtr -s -ei -zp4 -zt0
#CFLAGS += -obl+m
ifeq ($(CC),wpp386)
CFLAGS += -oi+
else
CFLAGS += -oi
endif
endif
CFLAGS += -i. -i$(HB_INC_COMPILE)
ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -d2
endif
LD := wlink
ifeq ($(HB_BUILD_DEBUG),yes)
LDFLAGS += DEBUG ALL
endif
# different SYS values: dos4g (default), pmodew (commercial), causeway,
# dos32a (DOS/32A LE executable), dos32x (DOS/32A LX executable)
LDFLAGS += SYS dos32a
# workaround for not included automatically CLIB in pure C mode builds
ifeq ($(CC),wcc386)
LDFLAGS += LIB clib3r.lib
endif
LDLIBS := $(HB_USER_LIBS)
LDLIBS += $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib))
ifneq ($(HB_LINKING_RTL),)
ifneq ($(HB_HAS_WATT),)
LDLIBS += $(HB_LIB_WATT)/wattcpwf
endif
endif
ifeq ($(HB_BUILD_DLL),yes)
DY := $(LD)
DFLAGS += OP quiet SYS cwdllr
DY_OUT :=
DLIBS := $(foreach lib,$(HB_USER_LIBS),$(lib))
DLIBS += $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib))
DLIBS += $(foreach lib,$(SYSLIBS),$(lib))
DLIBS := $(strip $(DLIBS))
ifneq ($(DLIBS),)
comma := ,
DLIBS_COMMA := LIB $(subst $(subst x,x, ),$(comma) ,$(DLIBS))
else
DLIBS_COMMA :=
endif
# NOTE: The empty line directly before 'endef' HAVE TO exist!
define dyn_object
@$(ECHO) $(ECHOQUOTE)FILE '$(file)'$(ECHOQUOTE) >> __dyn__.tmp
endef
define create_dynlib
$(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,)
$(foreach file,$^,$(dyn_object))
$(DY) $(DFLAGS) $(HB_USER_DFLAGS) NAME '$(subst /,$(DIRSEP),$(DYN_DIR)/$@)' OP implib='$(IMP_FILE)' @__dyn__.tmp $(DLIBS_COMMA)
endef
DY_RULE = $(create_dynlib)
endif # HB_BUILD_DLL
include $(TOP)$(ROOT)config/common/watcom.mk