* utils/hbmk2/hbmk2.prg
+ Added support for source file parsing for headers in -inc mode.
.prg, .c and .rc files are currently parsed recursively,
include paths will be scanned for included files. There are
currently three levels of scanning: disabled, partial (default)
and full. Partial will scan the first 16K of each source file
for performance reasons, full will scan the complete files.
The source parser is currently very simple; '#include "<filename>"'
pattern is recognized anywhere in the processed source, no
other variations are supported ATM. Using this format is IMO
best practice for user programs, if someone needs more
than this, it needs to be developed, current method is quite
fast, which is important when dealing with lots of source
files.
+ Added option to control header scanning: -[no]head=<mode>
This is also supported in .hbp files.
+ Added support to look in current dir for libs for compilers
where this is supported.
+ Added cmdline option -resflag=, .hbp option resflags= and
overall support for user supplied resource compiler flags.
+ Added support for cyg*.dll style libs.
! Fixed to handle libs with explicit dirs for compilers
where this is supported.
* config/dos/owatcom.cf
* config/win/owatcom.cf
* config/linux/owatcom.cf
* config/os2/owatcom.cf
+ Added link to wlink options.
159 lines
3.7 KiB
CFEngine3
159 lines
3.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
|
|
# ---------------------------------------------------------------
|
|
|
|
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
|
|
|
|
OBJ_EXT = .obj
|
|
EXE_EXT = .exe
|
|
LIB_PREF =
|
|
LIB_EXT = .lib
|
|
|
|
ifeq ($(SHLVL),)
|
|
ECHO=echo.
|
|
DSEP=$(subst /,\,\)
|
|
else
|
|
ECHO=echo
|
|
DSEP=$(subst /,\,\\)
|
|
endif
|
|
|
|
$(HB_ARCHITECTURE)_$(HB_COMPILER)_GRANDP = $(subst /,\,$(GRANDP))
|
|
|
|
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=DOS
|
|
|
|
ifneq ($(HB_BUILD_WARN),no)
|
|
CPPFLAGS += -w3
|
|
endif
|
|
|
|
ifneq ($(HB_BUILD_OPTIM),no)
|
|
# architecture flags
|
|
CPPFLAGS += -5r -fp5
|
|
|
|
# optimization flags
|
|
# don't enable -ol optimization in OpenWatcom 1.1 - gives buggy code
|
|
CPPFLAGS += -onaehtr -s -ei -zp4 -zt0
|
|
#CPPFLAGS += -obl+m
|
|
ifeq ($(CC),wpp386)
|
|
CPPFLAGS += -oi+
|
|
else
|
|
CPPFLAGS += -oi
|
|
endif
|
|
endif
|
|
|
|
CPPFLAGS += -i. -i$(TOP)$(ROOT)include
|
|
ifneq ($(HB_LIB_COMPILE),)
|
|
CPPFLAGS += -i$(HB_INC_COMPILE)
|
|
endif
|
|
|
|
ifeq ($(HB_BUILD_DEBUG),yes)
|
|
CPPFLAGS += -d2
|
|
endif
|
|
|
|
# work arround to DOS command line size limit
|
|
export WPP386 := $(strip $(CPPFLAGS))
|
|
CPPFLAGS =
|
|
|
|
# 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 $(subst /,$(DSEP),$(subst \,/,$(file))) >> __link__.tmp
|
|
|
|
endef
|
|
|
|
#Note: The empty line directly before 'endef' HAVE TO exist!
|
|
define link_lib
|
|
$(ECHO) LIB $(subst /,$(DSEP),$(subst \,/,$(lib))) >> __link__.tmp
|
|
|
|
endef
|
|
|
|
define link_exe_file
|
|
$(ECHO) $(subst /,$(DSEP),$(subst \,/,$(LDFLAGS))) NAME $@ > __link__.tmp
|
|
$(foreach file, $(^F), $(link_file))
|
|
$(foreach lib, $(HB_USER_LIBS), $(link_lib))
|
|
$(foreach lib, $(LINKLIBS), $(link_lib))
|
|
$(foreach lib, $(RDDLIBS), $(link_lib))
|
|
$(foreach lib, $(GTLIBS), $(link_lib))
|
|
-$(LD) @__link__.tmp
|
|
endef
|
|
|
|
LD = wlink
|
|
# other SYS values: dos4g (default), pmodew (commercial)
|
|
LDFLAGS = SYS causeway
|
|
ifeq ($(HB_BUILD_DEBUG),yes)
|
|
LDFLAGS := debug all $(LDFLAGS)
|
|
endif
|
|
|
|
ifeq ($(HB_LIB_COMPILE),)
|
|
LINKLIBS = $(foreach lib, $(CONTRIBS), $(LIB_DIR)/$(lib))
|
|
LINKLIBS += $(foreach lib, $(LIBS), $(LIB_DIR)/$(lib))
|
|
else
|
|
LINKLIBS = $(foreach lib, $(CONTRIBS), $(HB_LIB_COMPILE)/$(lib))
|
|
LINKLIBS += $(foreach lib, $(LIBS), $(HB_LIB_COMPILE)/$(lib))
|
|
endif
|
|
|
|
# If LIBS specifies the rdd library, add all DB drivers.
|
|
ifeq ($(findstring rdd,$(LIBS)),rdd)
|
|
ifeq ($(HB_LIB_COMPILE),)
|
|
RDDLIBS = $(foreach drv, $(HB_DB_DRIVERS), $(LIB_DIR)/$(drv))
|
|
else
|
|
RDDLIBS = $(foreach drv, $(HB_DB_DRIVERS), $(HB_LIB_COMPILE)/$(drv))
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(findstring rtl,$(LIBS)),rtl)
|
|
ifeq ($(HB_LIB_COMPILE),)
|
|
GTLIBS = $(foreach gt, $(HB_GT_LIBS), $(LIB_DIR)/$(gt))
|
|
else
|
|
GTLIBS = $(foreach gt, $(HB_GT_LIBS), $(HB_LIB_COMPILE)/$(gt))
|
|
endif
|
|
endif
|
|
|
|
LD_RULE = $(link_exe_file) $(HB_USER_LDFLAGS)
|
|
|
|
#Note: The empty line below HAVE TO exist!
|
|
define lib_object
|
|
$(ECHO) -+$(subst /,$(DSEP),$(subst \,/,$(file))) >> __lib__.tmp
|
|
|
|
endef
|
|
|
|
define create_library
|
|
$(ECHO) $(subst /,$(DSEP),$(subst \,/,$(LIB_DIR)))$(DSEP)$@ > __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)
|
|
|
|
include $(TOP)$(ROOT)config/rules.cf
|
|
|
|
HB := $(subst /,$(DSEP),$(subst \,/,$(HB)))
|
|
HB_FLAGS := $(subst /,$(DSEP),$(subst \,/,$(HB_FLAGS)))
|
|
|
|
# work arround to DOS command line size limit
|
|
export HARBOURCMD := $(HB_FLAGS)
|
|
HB_FLAGS =
|