* harbour/config/win/watcom.cf
* added SYS NT to link options - it's default in Windows builds but
is necessary in cross builds
* harbour/config/global.cf
* small modification in platform checking order to reduce possible
interactions with some extended host information
+ added automatic HB_BIN_COMPILE setting based on binaries located
in PATH.
! export some variables to avoid repeated setting in recursive calls
what causes some bad side effects, i.e. multiple __PLATFORM__*
macro settings in cross builds what was breaking cross compilation
and also slow down the whole build process.
129 lines
2.7 KiB
CFEngine3
129 lines
2.7 KiB
CFEngine3
#
|
|
# $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
|
|
# ---------------------------------------------------------------
|
|
|
|
OBJ_EXT = .obj
|
|
EXE_EXT = .exe
|
|
LIB_PREF =
|
|
LIB_EXT = .lib
|
|
|
|
ifeq ($(HB_BUILD_MODE),c)
|
|
CC = wcc386
|
|
endif
|
|
ifeq ($(HB_BUILD_MODE),cpp)
|
|
CC = wpp386
|
|
endif
|
|
# Build in C++ mode by default
|
|
ifeq ($(HB_BUILD_MODE),)
|
|
CC = wpp386
|
|
endif
|
|
CC_IN =
|
|
CC_OUT = -fo=
|
|
|
|
CPPFLAGS = -zq -bt=NT -bm
|
|
|
|
ifneq ($(HB_BUILD_WARN),no)
|
|
CPPFLAGS += -w3
|
|
endif
|
|
|
|
ifneq ($(HB_BUILD_OPTIM),no)
|
|
# architecture flags
|
|
CPPFLAGS += -6s -fp6
|
|
|
|
# optimization flags
|
|
# don't enable -ol optimization in OpenWatcom 1.1 - gives buggy code
|
|
# -oxaht
|
|
CPPFLAGS += -onaehtr -s -ei -zp4 -zt0
|
|
ifeq ($(CC),wpp386)
|
|
CPPFLAGS += -oi+
|
|
else
|
|
CPPFLAGS += -oi
|
|
endif
|
|
else
|
|
CPPFLAGS += -3s
|
|
endif
|
|
|
|
CPPFLAGS += -i. -i$(TOP)$(ROOT)include
|
|
|
|
ifeq ($(HB_BUILD_DEBUG),yes)
|
|
CPPFLAGS += -d2
|
|
endif
|
|
|
|
ifeq ($(CC),wcc386)
|
|
ifneq ($(HB_HOST_ARCH),linux)
|
|
CPPFLAGS := $(subst /,\,$(CPPFLAGS))
|
|
CC_RULE = $(CC) $(CPPFLAGS) $(subst /,\,$(CFLAGS)) $(HB_CDBG) $(subst /,\,$(HB_USER_CFLAGS)) $(HB_CDYNLIB) $(CC_IN)$(subst /,\,$<) $(CC_OUT)$(<F:.c=$(OBJ_EXT))
|
|
endif
|
|
endif
|
|
|
|
# Note: The empty line directly before 'endef' HAVE TO exist!
|
|
# It causes that the 'echo' command is 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 $(EXE_DIR)/$@ > __link__.tmp
|
|
$(foreach file, $(^F), $(link_file))
|
|
$(foreach lib, $(LINKLIBS), $(link_lib))
|
|
$(foreach lib, $(RDDLIBS), $(link_lib))
|
|
$(foreach lib, $(GTLIBS), $(link_lib))
|
|
@echo LIB ws2_32.lib >> __link__.tmp
|
|
-$(LD) @__link__.tmp
|
|
endef
|
|
|
|
LD = wlink
|
|
LDFLAGS = SYS NT
|
|
ifeq ($(HB_BUILD_DEBUG),yes)
|
|
LDFLAGS := debug all $(LDFLAGS)
|
|
endif
|
|
|
|
LINKLIBS = $(foreach lib, $(LIBS), $(LIB_DIR)/$(lib))
|
|
|
|
# If LIBS specifies the RDD library, add all DB drivers.
|
|
ifeq ($(findstring hbrdd,$(LIBS)),hbrdd)
|
|
RDDLIBS = $(foreach drv, $(HB_DB_DRIVERS), $(LIB_DIR)/$(drv))
|
|
endif
|
|
|
|
ifeq ($(findstring hbrtl,$(LIBS)),hbrtl)
|
|
GTLIBS = $(foreach gt, $(HB_GT_LIBS), $(LIB_DIR)/$(gt))
|
|
endif
|
|
|
|
LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS)
|
|
|
|
#Note: The empty line below 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) @__lib__.tmp
|
|
endef
|
|
|
|
AR = wlib
|
|
ARFLAGS = -p=64 -c -n $(HB_USER_AFLAGS)
|
|
AR_RULE = $(create_library)
|
|
|
|
# disable DOS/4GW Banner
|
|
export DOS4G=quiet
|
|
|
|
include $(TOP)$(ROOT)config/rules.cf
|