#/*****************************************************************************
#**                                                                          **
#**          The Clam Shell is Copyright (C) 1988 by Callum Gibson.          **
#**       This file is part of Clam Shell. You may freely use, copy and      **
#**     distribute it, but if you alter any source code do not distribute    **
#**   the altered copy. i.e. you may alter this file for your own use only.  **
#**                                                                          **
#*****************************************************************************/
# insert compiler flags here.
# CFLAGS are used when compiling each file
# LDFLAGS are used when linking
#
#CFLAGS= -O -I/usr/include2 
#CFLAGS= -3
#CFLAGS=-gx
#CFLAGS= -ansi
#CFLAGS= -O
#LDFLAGS= -3
#LDFLAGS= -i

# And the name of your compiler (may not be cc)
#CC=/usr/bin2/cc
#CC=/local/bin/bcc
#CC=gcc

# Some compilers generate object files that don't end in `.o'. Alter the
# following variable if this is the case
#O= s
O= o

# Depending upon what type of machine you are compiling this for, uncomment
# one of the following sections

# Pyramid Dual Universe machine under SysV
#DEFINES=-DUNIVERSE -DATT -DHASH -DSCRIPT
#CLIB=-lcurses

# Pyramid Dual Universe machine under BSD 4.x
#DEFINES=-DUNIVERSE -DUCB -DHASH -DSCRIPT -DJOB
#CLIB=-ltermcap

# Generic SysV machine
#DEFINES=-DATT -DHASH -DSCRIPT
#CLIB=-lcurses

# Generic BSD 4.x machine
#DEFINES=-DUCB -DHASH -DJOB -DSCRIPT
#CLIB=-ltermcap

# Sun OS
#DEFINES=-DUCB -DSUN -DHASH -DJOB -DSCRIPT
#CLIB=-ltermcap

# Coherent -- comment out the .c.$(O) rule down below, since Coherent
# Make already has it defined in /usr/lib/makeactions & pukes with the
# redefinition.
#DEFINES= -DNEED_GETCWD
#CLIB= -lterm -lndir
#STACK = 3000
#FINAL_TOUCHES = fixstack $(STACK) clam ; chmod 755 clam ; size clam
#CFLAGS = -O -VSUVAR $(DEFINES)

# Intel-based Minix, both 16 and 32-bit versions.
# Clam won't compile under Minix 1.5.10, because asld runs out of symbol
# table space. It may just compile under 1.3c. At the moment I'm using a
# mixture of the K&R compiler and the Ansi compiler to avoid asld.
#DEFINES=-DMINIX
#STACK = 30000
#FINAL_TOUCHES= chmem '=$(STACK)' clam

# Motorola-based Minix.
# Start with the following for Atari, Amiga and Mac Minix.
# The following was used to compile Clam under the previous version of
# ST Minix, using GnuC. Because ST & PC Minix 1.5.10 are nearly identical,
# try compiling _without_ -DATARI_ST and see if Clam compiles & runs.
# If not, try with the define. Once you get it to go, please send patches!
#DEFINES=-DMINIX -DATARI_ST
#CLIB= -ldir32 -liio32 -s -z
#STACK = 30000
#FINAL_TOUCHES= chmem '=$(STACK)' clam

SRCS= alias.c builtin1.c builtin2.c clex.c comlined.c cx.c \
	exec.c file.c global.c hash.c hist.c job.c main.c \
	meta.c parse.c prints.c var.c

OBJS= alias.$(O) builtin1.$(O) builtin2.$(O) clex.$(O) comlined.$(O) cx.$(O) \
	exec.$(O) file.$(O) global.$(O) hash.$(O) hist.$(O) job.$(O) \
	main.$(O) meta.$(O) parse.$(O) prints.$(O) var.$(O)

clam : $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o clam $(CLIB)
	$(FINAL_TOUCHES)

$(OBJS): Makefile header.h

# For Coherent, comment the next two lines out!
.c.$(O): $<
	$(CC) $(CFLAGS) $(DEFINES) -c $<

lint : $(SRCS)
	lint $(LINTFLAGS) $(DEFINES) $(SRCS)

clean :
	rm -f *.$(O) clam

store : clean
	compress *.c

retrieve :
	uncompress *.c.Z

delete :
	@ echo "have you backed up? Waiting for 5 seconds..."
	@ sleep 1;echo -n "going..."
	@ sleep 2;echo -n "going..."
	@ sleep 2;echo "GONE\!\!"
	rm -f *.$(O) *.c clam
