# 
# Makefile for scannerdriver and motif interface
#
.PRECIOUS: .a .c
CFLAGS = -DANSI -Wformat

LIBS = -L/usr/X11R6/lib -lXmind -lXm -lXpm -lXt -lX11 -lm -lc -lSM -lICE -lXext 


ALL = scan
OBJ = scan_main.o scan.o

all: $(ALL) ep_scan

.c.o:
	cc -c $(CFLAGS) $< 2> errorlog ; cat errorlog

$(ALL) : $(OBJ)
	cc -o $(ALL) $(OBJ) $(LIBS)  2>> errorlog ; cat errorlog
	cc -o $(ALL).static $(OBJ) $(LIBS) -static 2>> errorlog ; cat errorlog


ep_scan : ep_scan.c sg.h
	cc ep_scan.c -o ep_scan
	

clean:
	rm -f output.ppm
	rm -f *.o
	rm -f *.BAK
	rm -f ep_scan
	rm -f scan
	rm -f errorlog
	rm -f output.*

distrib:
	
	(cd ..; tar -cvzf scan/ep_scan.tgz 	scan/do_scan.c  \
				scan/ep_scan.c  \
				scan/scan.c	   \
				scan/scan_main.c\
				scan/sg.h	   \
				scan/Makefile   \
				scan/scan_icon.xpm \
				scan/scan \
				scan/scan.static \
				scan/ep_scan \
				scan/README )
