#compiler definitions for cross-compilation using a QNX target to run the tools
#this configuration requires a user identified by QNX_BUILD_USER to have rsh
#permissions on the target at QNX_BUILD_HOST. In addition, this script assumes
#an NFS or Samba (I recommend NFS) mounted filesystem structure such that it
#mirrors what is on the host where make is being run. For example, if your
#local directory starts at /home/someuser, then you should mount this at
#/home/someuser on the target. Then we can simply "cd" to the current working
#directory identified on the computer where you're running make. Also, since
#rsh doesn't instantiate a tty for the shell, the watcom tools don't print out
#the expansion of the cc command into the lower level compiler phases.

QNX_BUILD_PREFIX = rsh -l $(QNX_BUILD_USER) $(QNX_BUILD_HOST) \
	'cd $(shell pwd);'
CC	    = $(QNX_BUILD_PREFIX)cc
CXX	    = $(QNX_BUILD_PREFIX)cc
CCPP	    = $(QNX_BUILD_PREFIX)cc
LD	    = $(QNX_BUILD_PREFIX)cc
AR 	    = $(QNX_BUILD_PREFIX)wlib
YACC	    = $(QNX_BUILD_PREFIX)yacc
LEX	    = $(QNX_BUILD_PREFIX)lex
IDLTOCPP    = $(QNX_BUILD_PREFIX)idlToC++

#since the dependencies don't include system headers, we can run this locally
DEPEND_TOOL = gcc -MM

#various qnx/watcom specific compile flags
DEBUG 	    = -g
EXCEPTION_HANDLING = -WC,-xs

## OPTIMIZE = -4 -Os
OPTIMIZE = 

## MAP_OUTPUT = -S -ms -M
MAP_OUTPUT =

CFLAGS	    = -c $(DEBUG) $(MAP_OUTPUT) $(OPTIMIZE) -D_QNX -DUNIX  
CPPFLAGS    = -c $(DEBUG) $(MAP_OUTPUT) $(OPTIMIZE) -D_QNX -DUNIX \
	         $(EXCEPTION_HANDLING)
