#
# @(#)Makefile	1.14 03/28/97
#
# Makefile for "nosql" experimental stuff.
#
# $Id: Makefile,v 1.1 1998/05/29 20:42:35 carlos Exp $

#
# Set this to your favorite C compiler.
#
CC=gcc -g
CFLAGS=-O2

# Uncomment/change this to fit your installation.
#CFLAGS=-m486 -DCPU=686 -O2

#
# Set this to the directory you'd like to install programs in.
#
DESTDIR=/usr/local/bin

# Set this to the full-path of your AWK executable.
#
AWK=/usr/bin/awk

############################################################
#       End of Makefile customization section              #
############################################################
 

# Max. length of the embedded AWK program.
MAX_COMMAND_LENGTH=4096

MYCFLAGS=-DMAX_COMMAND_LENGTH=$(MAX_COMMAND_LENGTH) \
	-DAWK='"$(AWK)"' -DTESTPROG

ALL=nsq-fcol nsq-ncol nsq-fcompute nsq-frow nsq-fsort nsq-look \
	nsq-fjoin soundex nsq-header nsq-body nsq-t2sh nsq-xenv \
	nsq-cursor nsq-trunc nsq-t2html3

all: $(ALL)

%: %.c
	$(CC) $(CFLAGS) $(MYCFLAGS) -o $@ $<

install: $(ALL)
	for i in $(ALL) ; \
	do \
	  rm -f $(DESTDIR)/$$i ; \
	  cp $$i $(DESTDIR)/$$i ; \
	  chmod 755 $(DESTDIR)/$$i ; \
    done ; \
	cp nsq-soundex $(DESTDIR) 

clean:
	rm -rf $(ALL)

