#/*****************************************************************************
#**                                                                          **
#**          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= -O -i
#CFLAGS=-gx
DFLAGS=
#DFLAGS=-DDEBUG

# And the name of your compiler (may not be cc)
#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

# For Minix, I've left out HASHing & SCRIPTs to save space. JOB control
# won't work at all, so that's not defined. On my machine, both the
# termcap & directory calls are in separate libraries.
DEFINES=-DMINIX
CLIB=-ltermcap -ldir

# Atari-ST Minix, using the Gnu C compiler. If you are using the ACK
# compiler, try the previous section. I don't guarantee this will work
# with Gnu C either, as I don't have Gnu to test it with.
#DEFINES=-DMINIX -DATARI_ST
#CLIB= -ldir32 -liio32 -s -z

clam : 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) var.$(O)
	$(CC) $(CFLAGS) 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) var.$(O) -o clam $(CLIB)


alias.$(O) : alias.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c alias.c


builtin1.$(O) : builtin1.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c builtin1.c


builtin2.$(O) : builtin2.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c builtin2.c


clex.$(O) : clex.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c clex.c


comlined.$(O) : comlined.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c comlined.c


cx.$(O) : cx.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c cx.c


exec.$(O) : exec.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c exec.c


file.$(O) : file.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c file.c


global.$(O) : global.c header.h
	$(CC)  $(CFLAGS) $(DEFINES) -c global.c


hash.$(O) : hash.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c hash.c


hist.$(O) : hist.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c hist.c


job.$(O) : job.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c job.c


main.$(O) : main.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c main.c


meta.$(O) : meta.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c meta.c


parse.$(O) : parse.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c parse.c


var.$(O) : var.c header.h
	$(CC) $(DFLAGS) $(CFLAGS) $(DEFINES) -c var.c

lint : header.h 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 var.c
	lint $(DEFINES) header.h 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 var.c

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
