# Makefile - for vxConfig 
#
# modification history
# --------------------
# 01d,28oct10,mze  add dependencies
# 01c,05may08,mze  fixing location of vxConfig file
# 01b,21apr08,mze  adding new file
# 01a,15apr08,mze  written.
#
# DESCRIPTION
# This file contains the makefile rules for building vxConfig
# a Wind River version of the Linux Kconfig utility. This tool
# is used exclusivly by vxprj for the configuration of VSBs
#
# SUBSTITUTION
#
# INCLUDES
#	$(WIND_BASE)/host/include/make/generic.mh
#	$(WIND_BASE)/host/include/make/$(HOST).mh
#	$(WIND_BASE)/host/include/make/generic2.mh
#

include 	$(WIND_BASE)/host/include/make/generic.mh
include		$(WIND_BASE)/host/include/make/$(HOST).mh


INCLUDES	= -I.

VXCONFIG=$(WIND_BASE)/host/$(HOST)/bin/vxConfig
VXCONFIG_OBJS=conf.o zconf.tab.o

ALLSRC = $(wildcard *.c) $(wildcard *.h)


FULL_NAME_OFILES= $(patsubst %.o,$(HOST)/%.o,$(VXCONFIG_OBJS))
ifneq ($(HOST),x86-win32)
	LOCAL_CFLAGS	= -static -g -DKBUILD_NO_NLS=no  -DNO_REGEX -DVXWORKS -DNO_UNAME
endif

# need to overwrite the gnu_CFLAGS for solaris and Linux to remove the -ansi flag

ifeq ($(HOST),sun4-solaris2)
gnu_CFLAGS		= -Wall -Dsparc $($(EXETYPE)_DLL_FLAG) \
			  -DSUN4_SOLARIS2 -DVXWORKS -D__EXTENSIONS__ -D_REENTRANT
endif

ifeq ($(HOST),x86-linux2)			  
gnu_CFLAGS		= $($(EXETYPE)_DLL_FLAG) \
			  -Wall -DLINUX -Dlinux -D__EXTENSIONS__ -D_REENTRANT \
			  -D_POSIX_SOURCE -DVXWORKS -D_BSD_SOURCE -D_XOPEN_SOURCE=2000 \
			  -O2
endif

LIBRARIES	=
PROGRAMS	= $(VXCONFIG)

## Add special build targets and default here.

default: objdircre $(VXCONFIG)

$(VXCONFIG):	$(FULL_NAME_OFILES)
		$(CC) $(EXPORT_FLAGS) -o $@ $(FULL_NAME_OFILES)

$(FULL_NAME_OFILES) : $(ALLSRC)

include		$(WIND_BASE)/host/include/make/generic2.mh

## Dependencies below generated by compiler's handy -M flag.
