#############################################################################
#
# gnu.mak - builds the chart example for vxWorks
#
#############################################################################

TOOL    = gnu
#CPU     = I80486

LIB_DIR=$(ZINC_COMPILER)

ADD_COMPILE_OPTIONS=-DUGL_OS_HEADER=uosVxw.h -DZAF_VXW_APP_NAME=zafapp \
 -DUGL_ARCH_HEADER=$(UGL_ARCH_HEADER)

TGT_DIR=$(WIND_BASE)/target

ifndef CPU
# you need to make sure that CPU is defined as an 
# environment variable or a macro
CPU=_CPU_not_defined_
endif

include $(TGT_DIR)/h/make/defs.bsp
include $(TGT_DIR)/h/make/make.$(CPU)$(TOOL)
include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)

.SUFIXES: .c .cpp

ADD_LINK_OPTIONS=
ADD_LIBRARY_OPTIONS=

include $(ZAF_ROOT)/include/make.gnu

exe:
default: vchart.o

clean:
	$(RM) *.o

CHART_FILES=chart.cpp v_app.cpp
vchart.o: $(CHART_FILES:%.cpp=%.o)
	$(LINKER) $(LINK_OPTIONS) -o temp.o $^ $(LIB_OPTION) $(LIBRARIES)
# First munch line for Tornado 1.0.1. Second munch line for Tornado 2.0
#	$(NM) temp.o | munch > munch.c
	$(NM) temp.o | $(MUNCH) | $(POST_MUNCH) > munch.c
	$(COMPILER) $(COMPILE_OPTIONS) -traditional munch.c
	$(LINKER) -r -o $@ munch.o temp.o
	$(RM) temp.o
	$(RM) munch.c
	$(RM) munch.o
