#########################################
# There is a need to define GSCdat, 
# the root of the directory structure
# containing the 9,000 files.
GSCdat = /GSC
#
#########################################
#
##### Turbo-C Definitions on PCs
#CC    = tcc -I. -mh -O -Z -G -N
#CLEAN = del *.obj
#SLIB  =
#DEL   = del
##### Unix definitions
SHELL = /bin/sh
CC    = cc -I. -O
CLEAN = strip a.out ; rm -f *.o ; mv a.out $@
SLIB  = -lm
COPY  = cp -p
DEL   = rm -f
#########################################

UTIL = prtgsc.c dispos.c decode_c.c get_head.c find_reg.c \
	to_d.c dtos.c
PGMS =  gsc.exe decode.exe
LIB  = gsc.lib

#SUFFIXES: .c .obj
#.c.obj:
#	$(CC) -c $*

default: decode.exe gsc.exe

gsc.exe: gsc.c $(UTIL) gsc.h
	$(CC) gsc.c $(UTIL) $(SLIB)
	$(CLEAN)

genreg.exe: genreg.c  get_head.c find_reg.c gsc.h
	$(CC) genreg.c get_head.c find_reg.c
	$(CLEAN)

decode: decode.c decode_c.c get_head.c prtgsc.c dtos.c gsc.h
	$(CC) decode.c decode_c.c get_head.c prtgsc.c dtos.c $(SLIB)
	$(CLEAN)

decode.exe: decode.c decode_c.c get_head.c prtgsc.c dtos.c gsc.h
	$(CC) decode.c decode_c.c get_head.c prtgsc.c dtos.c $(SLIB)
	$(CLEAN)

epoch: epoch.c get_head.c gsc.h
	$(CC) epoch.c get_head.c
	$(CLEAN)

all: $(PGMS)

install: $(PGMS)
	$(COPY) gsc.exe decode.exe ../bin
	$(MAKE) genreg.exe
	GSCDAT=`pwd`/..; export GSCDAT; genreg.exe -b -c -d

clean:
	$(DEL) *.exe epoch
