/*
 * Copyright (C) 1992  Board of Regents of the University of Wisconsin
 * on behalf of the Department of Electrical Engineering and Computer
 * Science, University of Wisconsin-Milwaukee, Milwaukee, WI 53201.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * The programs in this directory were developed by software engineering 
 * teams as part of the course "Introduction to Software Engineering" 
 * under the supervision of Professor G. Davida.
 * This is a modification of a program written or modified by
 * others.  The original copyrights, as per GNU General Public License,
 * may still be applicable.  The UWM copyright is applicable only
 * the those parts generated at UWM.
 *
 * Please send all changes, enhancements, and other comments about this
 * software to
 *     		soft-eng@cs.uwm.edu
 *
 * No Warranty, expressed or implied, comes with this software.
 * This software is intended to be used by not-for-profit
 * organizations or by individuals for personal HOME use. 
 * This software, or any of its parts, may not be used by for-profit
 * organization, regardless of application or intended product or
 * customer, without the permission of the Board of Regents of the 
 * University  of Wisconsin is strictly forbidden. 
 *
 * Contact:	soft-eng@cs.uwm.edu
 *			or
 *		
 *		Software Engineering Coordinator
 *		Computer Science
 *    		Department of EECS
 *		University of Wisconsin - Milwaukee
 *		Milwaukee, WI  53201
 *		414-229-4677
 *
 *		HISTORY,CLAIMS and CONTRIBUTIONS
 */

#  I use the latest gcc to find bugs..
#CC=gcc2.3.3
#CC=gcc

# Warning - edit config.h if you want to change various things...
#ifdef HPArchitecture
#if ProjectX < 5
CCOPTIONS = -Aa -D_HPUX_SOURCE -DRINT /* HP-UX 8.07 */
#else
CCOPTIONS = -Ae /* HP-UX 9.0X [already has rint()] */
#endif
#endif

# All of the source files
# psc.c - Convert ascii input to SC/XSpread format.

SRCS = cmds.c crypt.c format.c gram.c graphic_main.c help.c interp.c lex.c \
       matrix.c plot_XY.c plot_bar.c plot_line.c plot_pie.c plot_stk_bar.c \
       range.c sc.c screen.c scXstuff.c utils.c vi.c vmtbl.c version.c \
       xmalloc.c sort.c search.c color.c

OBJS = cmds.o crypt.o format.o graphic_main.o help.o interp.o lex.o \
       matrix.o plot_XY.o plot_bar.o plot_line.o plot_pie.o plot_stk_bar.o \
       range.o sc.o screen.o scXstuff.o utils.o vi.o vmtbl.o version.o \
       xmalloc.o sort.o search.o color.o

HDRS = config.h experres.h graphic_gvar.h pattern.h plot.h sc.h scXstuff.h \
       statres.h y.tab.h

# For OSF(DEC Alpha things) add -ldnet_stub
EXTRA_LIBRARIES = $(XLIB) -lm 
DEPENDS=$(HDRS)

#ifdef SparcArchitecture
#if OSMajorVersion >= 5
EXTRA_LIBRARIES = $(XLIB) -lm -lsocket -lnsl -lgen
#endif
#endif


ComplexProgramTarget(xspread)
SpecialObjectRule($(OBJS), $(DEPENDS), $(LOCAL_DEFINES))
InstallProgram(xspread,$(BINDIR))
InstallManPage(xspread,$(MANDIR))

experres.h: gram.y eres.sed
	$(RM) experres.h
	sed < gram.y > experres.h -f eres.sed

statres.h: gram.y sres.sed
	$(RM) statres.h
	sed < gram.y > statres.h -f sres.sed

gram.o: sc.h y.tab.h gram.c experres.h statres.h 
	$(CC) ${CFLAGS} -c gram.c

gram.c: gram.y
	$(RM) y.tab.h y.tab.c gram.c
	$(YACC) -d gram.y; mv y.tab.c gram.c
