# $Header: /home/amb/cxref/cpp/RCS/Makefile 1.7 1996/05/18 19:05:17 amb Exp $
#
# C Cross Referencing & Documentation tool. Version 1.1
#
# CPP Makefile.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1995,96 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

OBJ_FILES=cccp.o cexp.o version.o

# Read the README file for a description of these.
# For me using i486 Linux
INCLUDE_DIR1=/usr/local/include
INCLUDE_DIR2=/usr/i486-linux/include
INCLUDE_DIR3=/usr/lib/gcc-lib/i486-linux/2.5.8/include

INCLUDES=-Iconfig
LIB=

CC=gcc
CFLAGS=-O2

COMPILE=$(CC) -c $(CFLAGS)

LINK=$(CC) 

YACC=bison -y

########

cxref-cpp : $(OBJ_FILES)
	$(LINK) $(OBJ_FILES) -o $@ $(LIB)

########

cexp.c : cexp.y
	$(YACC) $<
	@mv y.tab.c cexp.c

####

cccp.o: cccp.c config.h tm.h pcp.h
	$(COMPILE) -w $< -o $@ $(INCLUDES) \
	  -DLOCAL_INCLUDE_DIR=\"$(INCLUDE_DIR1)\" \
	  -DTOOL_INCLUDE_DIR=\"$(INCLUDE_DIR2)\" \
	  -DGCC_INCLUDE_DIR=\"$(INCLUDE_DIR3)\" \
	  -DGPLUSPLUS_INCLUDE_DIR=\".\"

####

%.o:%.c
	$(COMPILE) -w $< -o $@ $(INCLUDES)

version.o    : version.c
cexp.o       : cexp.c config.h tm.h

########

clean :
	-rm -f core *.o *~ y.tab.c

########
