#
#   Mash -- MAke SHell
#   Copyright (c) 1997  Salvatore Valente <svalente@mit.edu>
#
#   This program is free software.  You can modify and distribute it under
#   the terms of the GNU General Public License.  There is no warranty.
#   See the file "COPYING" for more information.
#
#   $Revision: 1.3 $
#

set srcdir=	 @srcdir@
set prefix=	 @prefix@
set exec_prefix= @exec_prefix@
set bindir=	 @bindir@
set etcdir=	 @sysconfdir@
set datadir=	 @datadir@

set PROG=	mash
set OBJS=     ( mash.o getopt.o hash.o list.o tklist.o lex.o compile.o
		interp.o glob.o exec.o rule.o function.o test.o )
set CC=		gcc -Wall
set CFLAGS=	-g
set LDFLAGS=
set config=	$(etcdir)/mash.conf

depend all: $(PROG)

target $(PROG): $(OBJS)
	$(CC) $(LDFLAGS) -o $(target) $(depends) $(LIBS)

target mash.o < c
	$(CC) $(CFLAGS) -DCONFIG_FILE'='"$(config)" -c $(from) -o $(target)

suffix o < c
	$(CC) $(CFLAGS) -c $(from) -o $(target)

target install: $(PROG) $(PROG).1 $(PROG).conf {
	install -c -s $(PROG) $(bindir)
	cp conf/`/bin/uname` $(config)
}

target clean
	rm -f $(PROG) *.o *~ core

target distclean: clean
	rm -f Makefile Mashfile TAGS config.cache config.log config.status

set    mash_h =		mash.h list.h tklist.h hash.h
depend mash.o:		$mash_h getopt.h
depend getopt.o:	getopt.h
depend hash.o:		hash.h
depend list.o:		list.h
depend tklist.o:	tklist.h
depend lex.o:		$mash_h
depend compile.o:	$mash_h
depend interp.o:	$mash_h glob.h
depend glob.o:		glob.h
depend exec.o:		$mash_h
depend rule.o:		$mash_h
