# $Id: Makefile_without_perl 11992 2006-01-16 18:59:58Z wsnyder $ */
#*****************************************************************************
#
# DESCRIPTION: Verilog::Preproc:  Example make for standalone C++ preprocessor
#
# Code available from: http://www.veripool.com/
#
#*****************************************************************************
#
# Copyright 2000-2006 by Wilson Snyder.  This program is free software;
# you can redistribute it and/or modify it under the terms of either the GNU
# General Public License or the Perl Artistic License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
#****************************************************************************/

#### Start of system configuration section. ####

srcdir = .
VPATH = .

CXX = g++
LINK = g++

#### End of system configuration section. ####

LEX = flex
#LEXFLAGS = -d
#LDFLAG = -d -g
LDFLAG = -g
YFLAGS = -d -v

LIBS = -ll -lm
COPT = -ggdb

CPPFLAGSNOWALL = -MMD -I. -I$(srcdir) $(COPT)
CPPFLAGS = $(CPPFLAGSNOWALL) -Wall -Wno-char-subscripts -Werror

HEADERS = symboltab.h $(wildcard V*.h v*.h)

######################################################################
#### Top level

all: example

#### Top executable

OBJS = \
	example.o \
	VPreproc.o \
	VFileLine.o \
	VPreprocLex.o \

example: $(OBJS)
	${LINK} ${LDFLAGS} -o $@ $^ ${LIBS}

#### Modules

example.o:	example.cpp VPreproc.h

VPreprocLex.cpp: VPreprocLex.l
	${LEX} ${LEXFLAGS} -o$@ $<

VPreprocLex.o:	VPreprocLex.cpp
	${CXX} ${CPPFLAGSNOWALL} -c $<

######################################################################
######################################################################

DEPS := $(wildcard *.d)
ifneq ($(DEPS),)
include $(DEPS)
endif

