Files
harbour-core/config/common/watcom.mk
Viktor Szakats 760112e3c5 2017-09-12 15:13 UTC Viktor Szakats (vszakats users.noreply.github.com)
* bin/check.hb
  * config/*/*.mk
  * contrib/gtwvg/wvgwing.c
  * contrib/hbcomm/comm.prg
  * contrib/hbfbird/tfirebrd.prg
  * contrib/hbfimage/fi_wrp.c
  * contrib/hbformat/hbfmtcls.prg
  * contrib/hbformat/utils/hbformat.prg
  * contrib/hbhttpd/core.prg
  * contrib/hbnetio/utils/hbnetio/hbnetio.prg
  * contrib/hbnetio/utils/hbnetio/netiomgm.hb
  * contrib/hbsqlit3/hdbc.prg
  * contrib/hbwin/win_bmp.c
  * contrib/xhb/htmutil.prg
  * contrib/xhb/thtm.prg
  * contrib/xhb/xhbarr.c
  * contrib/xhb/xhbtedit.prg
  * ChangeLog.txt
  * debian/control
  * debian/copyright
  * doc/*.txt
  * LICENSE.txt
  * package/harbour.spec
  * README.md
  * src/compiler/hbusage.c
  * src/pp/hbpp.c
  * src/rtl/memoedit.prg
  * src/rtl/teditor.prg
  * src/rtl/tget.prg
  * src/rtl/version.c
  * utils/hbi18n/hbi18n.prg
  * utils/hbmk2/hbmk2.prg
  * utils/hbmk2/po/hbmk2.hu.po
  * utils/hbtest/hbtest.prg
    * sync with 3.4 fork (no change in functionality)
      CC3 -> CC4 license, copyright banners, some strings, minor
      code changes, doc folder, TOFIX -> FIXME
2017-09-12 15:15:14 +00:00

108 lines
3.2 KiB
Makefile

# GNU Make file for Open Watcom C/C++ compiler
# (shell specific rules)
# ---------------------------------------------------------------
# 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
# ---------------------------------------------------------------
# NOTE: Hack to force no extension for Linux binaries created on non-Linux hosts.
# Otherwise they become '.elf'. [vszakats]
ifeq ($(HB_PLATFORM),linux)
ifneq ($(HB_HOST_PLAT),linux)
BIN_EXT := .
endif
endif
AR := wlib
ARFLAGS += -q -p=72 -c -n
comma := ,
ifneq ($(RES_EXT),)
LDFILES_COMMA = $(subst $(subst x,x, ),$(comma) ,$(filter-out %$(RES_EXT),$(^F)))
LDRES_LIST = $(foreach file,$(filter %$(RES_EXT),$(^F)),OPT res=$(file))
else
LDFILES_COMMA = $(subst $(subst x,x, ),$(comma) ,$(^F))
LDRES_LIST :=
endif
LDLIBS_COMMA := $(subst $(subst x,x, ),$(comma) ,$(strip $(LDLIBS)))
LD_RULE = $(LD) $(LDFLAGS) $(HB_LDFLAGS) $(HB_USER_LDFLAGS) NAME $(BIN_DIR)/$@ FILE $(LDFILES_COMMA) $(LDRES_LIST) $(if $(LDLIBS_COMMA), LIB $(LDLIBS_COMMA),)
AR_RULE = $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(^F),-+$(file))
ifeq ($(HB_SHELL),dos)
# NOTE: The empty line directly before 'endef' HAS TO exist!
# It causes that every command will be separated by LF
define link_file
@$(ECHO) $(ECHOQUOTE)FILE $(file)$(ECHOQUOTE) >> __link__.tmp
endef
# NOTE: The empty line directly before 'endef' HAS TO exist!
define link_lib
@$(ECHO) $(ECHOQUOTE)LIB $(lib)$(ECHOQUOTE) >> __link__.tmp
endef
define link_exe_file
@$(ECHO) $(ECHOQUOTE)$(LDFLAGS) $(HB_LDFLAGS) NAME $(BIN_DIR)/$@$(ECHOQUOTE) > __link__.tmp
$(foreach file,$(^F),$(link_file))
$(foreach lib,$(LDLIBS),$(link_lib))
-$(LD) @__link__.tmp
endef
LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS)
# NOTE: The empty line directly before 'endef' HAS TO exist!
define lib_object
@$(ECHO) $(ECHOQUOTE)-+$(file)$(ECHOQUOTE) >> __lib__.tmp
endef
define create_library
@$(ECHO) $(ECHOQUOTE)$(LIB_DIR)/$@$(ECHOQUOTE) > __lib__.tmp
$(foreach file,$(^F),$(lib_object))
$(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp
endef
AR_RULE = $(create_library)
endif
ifneq ($(findstring wcc386,$(CC)),)
ifneq ($(HB_HOST_PLAT),linux)
CC_DIRSEPFROM := /
CC_DIRSEPTO := $(subst /,\,\)
endif
endif
include $(TOP)$(ROOT)config/rules.mk
ANYDOS := no
ifeq ($(HB_SHELL),dos)
ANYDOS := yes
endif
ifeq ($(HB_PLATFORM),dos)
ANYDOS := yes
endif
ifeq ($(ANYDOS),yes)
# disable DOS/4GW Banner
export DOS4G := quiet
# disable DOS/32A Banner
export DOS32A := /NOC
# work arround to DOS command line size limit
ifneq ($(findstring wcc386,$(CC)),)
export WCC386 := $(strip $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS)))
else
export WPP386 := $(strip $(subst $(CC_DIRSEPFROM),$(CC_DIRSEPTO),$(CC_FLAGS)))
endif
CC_FLAGS :=
export HARBOURCMD := $(HB_FLAGS)
HB_FLAGS :=
endif