
# Edit this according to your tcl and tk-installation:

# This directory contains the tcl-library-files
TCLLIBDIR=/usr/local/lib/tcl7.6/

# This directory contains the tk-library-files
TKLIBDIR= /usr/local/lib/tk4.2/

# The directory that contains tcl.h, tk.h and tix.h
TCLTKINCLUDE=/usr/local/include/

# The directory that contains the dynamic or static tcl/tk/tix-libraries
TCLTKLIB=/usr/local/lib/


#------------------End of user-editable section-----------------------


PROG=xcdroast
ETOBJS=tfdisk.o queryide.o scsiinq.o getcdtoc.o checkcd.o resetcd.o geteuid.o
ETSRC= xcdroast.c tfdisk.c queryide.c scsiinq.c getcdtoc.c checkcd.c resetcd.c geteuid.c
FLAGS= -O2 -Wall -I$(TCLTKINCLUDE) -I/usr/X11R6/include


xcdroast: $(ETOBJS) xcdroast-sam.o et.o 
	gcc -o $(PROG) $(ETOBJS) xcdroast-sam.o et.o -L$(TCLTKLIB) -ltixsam4.1.7.6 -ltk4.2 -ltcl7.6 -lX11 -ldl -lm -L/usr/X11R6/lib

xcdroast-dyn: $(ETOBJS) xcdroast.o et.o 
	gcc -o $(PROG) $(ETOBJS) xcdroast.o et.o -L$(TCLTKLIB) -ltix -ltk4.2 -ltcl7.6 -lX11 -ldl -lm -L/usr/X11R6/lib

etixwish: $(ETOBJS) etixwish.o et.o
	gcc -o etixwish $(ETOBJS) etixwish.o et.o -L$(TCLTKLIB) -ltixsam4.1.7.6 -ltk4.2 -ltcl7.6 -lX11 -ldl -lm -L/usr/X11R6/lib

xcdroast.c: xcdroast.et et2c
	et2c xcdroast.et >xcdroast.c

xcdroast.o: xcdroast.c
	gcc $(FLAGS) -DTCLLIB="\"$(TCLLIBDIR)\"" -DTKLIB="\"$(TKLIBDIR)\"" -c xcdroast.c

xcdroast-sam.o: xcdroast.c
	gcc $(FLAGS) -DSAM -c xcdroast.c -o xcdroast-sam.o

etixwish.c: etixwish.et 
	et2c etixwish.et >etixwish.c

etixwish.o: etixwish.c
	gcc $(FLAGS) -c etixwish.c

tfdisk.o: tfdisk.c
	gcc $(FLAGS) -c tfdisk.c

tfdisk.c: tfdisk.et et2c
	et2c tfdisk.et >tfdisk.c

queryide.o: queryide.c
	gcc $(FLAGS) -c queryide.c

queryide.c: queryide.et et2c
	et2c queryide.et >queryide.c

scsiinq.o: scsiinq.c
	gcc $(FLAGS) -c scsiinq.c

scsiinq.c: scsiinq.et et2c
	et2c scsiinq.et >scsiinq.c

getcdtoc.o: getcdtoc.c
	gcc $(FLAGS) -c getcdtoc.c

getcdtoc.c: getcdtoc.et et2c
	et2c getcdtoc.et >getcdtoc.c

checkcd.o: checkcd.c
	gcc $(FLAGS) -c checkcd.c

checkcd.c: checkcd.et et2c
	et2c checkcd.et >checkcd.c

resetcd.o: resetcd.c
	gcc $(FLAGS) -c resetcd.c

resetcd.c: resetcd.et et2c
	et2c resetcd.et >resetcd.c

geteuid.o: geteuid.c
	gcc $(FLAGS) -c geteuid.c

geteuid.c: geteuid.et et2c
	et2c geteuid.et >geteuid.c

et2c:
	@echo 
	@echo "Read the file \"README.Compile\" first!"
	@echo 
	@exit 1

et.o:
	@echo 
	@echo "Read the file \"README.Compile\" first!"
	@echo 
	@exit 1

clean:
	rm -f $(ETOBJS) $(PROG) $(ETSRC) xcdroast.o xcdroast-sam.o etixwish etixwish.o etixwish.c core

install:
	strip $(PROG); cp $(PROG) ../..

