CC=cc
TAR=tar
V=1.1.0
ARCHIVE=\
dds2tar-$(V)/Makefile \
dds2tar-$(V)/Changes \
dds2tar-$(V)/README \
dds2tar-$(V)/dds2tar.lsm \
dds2tar-$(V)/dds2tar.1 \
dds2tar-$(V)/dds2tar.h \
dds2tar-$(V)/dds2tar.c \
dds2tar-$(V)/open_device.c \
dds2tar-$(V)/dds_extract.c \
dds2tar-$(V)/dds_index.c \
dds2tar-$(V)/dds_tapepos.c \


OBJ=dds2tar.o open_device.o dds_index.o dds_extract.o dds_tapepos.o

dds2tar: $(OBJ)
	$(CC) $(OBJ)  -o dds2tar

install: dds2tar
	install -c -s dds2tar /usr/bin
	install dds2tar.1 /usr/man/man1

tar: 
	cd .. ; echo ' ' ; $(TAR) -R -z -c -f dds2tar-$(V).tar.gz -v $(ARCHIVE) ; echo ' '
	cp dds2tar.lsm ../dds2tar-$(V).lsm
	ls -l ../dds2tar*z ../dds2tar*.lsm

.c.o:
	cc -c $< -O2

clean:
	rm $(OBJ)
	rm dds2tar

dds2tar.o:dds2tar.c dds2tar.h
dds_index.o:dds_index.c dds2tar.h
dds_extract.o:dds_extract.c dds2tar.h
dds_tapepos.o:dds_tapepos.c dds2tar.h
open_device.o:open_device.c dds2tar.h
