# VRML/Makefile
############################################################################

# use same configuration parameters as in parent directory
include ../Config.common
include ../Config.site

############################################################################
# No need to change anything below here
############################################################################
# the source files in this directory
SOURCES = nodegen.C fieldValue.C interfaceDeclaration.C MFNode.C SFNode.C Proto.C SFImage.C error.C y.tab.C
CSOURCES = lex.yy.c
OBJECTS = ${SOURCES:.C=.o} ${CSOURCES:.c=.o}

THISDIRFLAGS =  -I.

#default target: compile
all:
	@echo "Use make nodegen in order to build the nodegen program (you normally don't need it)"

# generate source file dependencies
depend: y.tab.C lex.yy.c version.H
	$(MAKEDEPEND) $(MKDEPFLAGS) $(SOURCES) > deps

nodegen: $(OBJECTS)
	$(CXX) $(LDFLAGS) -o nodegen $(OBJECTS)

# make a clean source tree again
cleanhere: cleangen
	-${RM} nodegen y.tab.* yacc.c++ yacc.h lex.yy.* y.output version.H
	${TOUCH} deps

clean: cleanhere

distclean: cleanhere

y.tab.C: yacc.y++
	$(YACC) -v yacc.y++
	mv y.tab.c y.tab.C
	cp y.tab.C yacc.c++
	cp y.tab.h yacc.h

lex.yy.c: lex.l yacc.y++
	$(LEX) lex.l

version.H:
	@echo "#define MAJOR_VERSION" ${MAJOR_VERSION}  > version.H
	@echo "#define MINOR_VERSION" ${MINOR_VERSION}  >> version.H
	@echo "#define RELEASE" '"'${RELEASE}'"'  >> version.H

###############################################################################
# dependencies --- automatically generated with make depend !!
###############################################################################
include deps


