3 #--------------------------------------------------------
4 # To compile everything: make
5 # To install the executables and man pages: make install
6 #--------------------------------------------------------
10 # Here are some configurable options:
11 ################################################################
13 # To enable the use of the log pages of an HPDAT,
14 # uncomment the following line :
17 # Default tape device is: /dev/nst0
18 # edit or uncomment the following line to change the default device
21 # Enable trace mode -- for debugging only
24 # The tape blocks are read into a buffer, so the buffer of dds2tar
25 # should be in the same size as the one in /usr/src/linux/driver/scsi/st.c
26 # of the kernel code. Set ST_BUFFER_BLOCKS to zero, in order to take the
27 # size from the kernel source directly.
29 # The number is halved, if EOVERFLOW is detected.
30 # The value of the kernel is normally ST_BUFFER_BLOCKS=32.
32 # To configure the buffer size of dds2tar
33 # change or uncomment the following line :
34 BUFFER=-DST_BUFFER_BLOCKS=32
35 # BUFFER=-DST_BUFFER_BLOCKS=0
37 # To include some experimental stuff
38 # uncomment the following line :
39 # EXP_STUFF=-DEXP_STUFF
41 # change this to where you want to install:
42 BINDIR=$(DESTDIR)/usr/bin
43 MANDIR=$(DESTDIR)/usr/share/man
46 # place here your favorite C compiler and options
48 CCOPT=$(HPDAT) $(HPDAT4) $(EXP_STUFF) $(MATCH) $(BUFFER) \
49 -DDEVICE=\"$(DEVICE)\" -O4 -Wall $(TRACE) -D_GNU_SOURCE
52 # -Wstrict-prototypes \
60 # -Wmissing-prototypes \
66 # nothing configurable below this line
67 ################################################################
69 .SUFFIXES: .c .o .man .$(MANEXT) .ps .s
73 CCFLAGS=-DVERSION=\"$V\"
99 $(D)/tar-1.11.2.patch \
100 $(D)/tar-1.11.8.patch \
101 $(D)/tar-1.12.patch \
102 $(D)/tar-1.13.patch \
103 $(D)/tar-1.11.2-sparse-files.patch \
104 $(D)/tar-1.11.2-sparse-files.README \
105 $(D)/dds2tar-test.sh \
107 $(D)/index-of-tar-v \
108 $(D)/index-of-tar-t \
109 $(D)/index-of-dds2index \
116 OBJ= dds_index.o dds_extract.o dds_tape.o dds_quote.o \
117 zf-cre-open.o dds_chkhdr.o
120 all: dds2tar dds2tar.1 dds2index.1 mt-dds.1 dds-dd.1
122 dds2tar: dds2tar.o $(OBJ)
123 $(CC) dds2tar.o $(OBJ) -o dds2tar
124 ln -f dds2tar dds2index
129 $(CC) tar2tar.c -o tar2tar
131 dds2index: dds2index.o $(OBJ)
132 $(CC) dds2index.o $(OBJ) -o dds2index
134 mt-dds: mt-dds.o $(OBJ)
135 $(CC) mt-dds.o $(OBJ) -o mt-dds
137 dds-dd: dds-dd.o $(OBJ)
138 $(CC) dds-dd.o $(OBJ) -o dds-dd
140 install: dds2tar ddstool \
141 dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
142 install -c dds2tar $(BINDIR)
143 install scsi_vendor $(BINDIR)
144 install -c ddstool $(BINDIR)
145 ls -l $(BINDIR)/dds2tar $(BINDIR)/ddstool
146 install -c dds2tar.$(MANEXT) $(MANDIR)/man$(MANEXT)
147 install -c dds2index.$(MANEXT) $(MANDIR)/man$(MANEXT)
148 install -c mt-dds.$(MANEXT) $(MANDIR)/man$(MANEXT)
149 install -c dds-dd.$(MANEXT) $(MANDIR)/man$(MANEXT)
150 ln -f $(BINDIR)/dds2tar $(BINDIR)/dds2index
151 ln -f $(BINDIR)/dds2tar $(BINDIR)/mt-dds
152 ln -f $(BINDIR)/dds2tar $(BINDIR)/dds-dd
155 tar: dds2tar.ps dds2index.ps mt-dds.ps dds-dd.ps ${T}.patch
156 -cd .. ; echo ' ' ; \
157 $(TAR) -R -c -f $(D).tar -v $(ARCHIVE) ;
160 gzip -9 -f ../$(D).tar
161 ls -l ../$(D).tar.gz | awk '{print $$5}' > archive_length
162 sed s/LENGTH/`cat archive_length`/ <dds2tar.lsm |\
163 sed s/VERSION/$(V)/ > ../$(D).lsm
164 ls -l ../dds2tar*z ../dds2tar*.lsm
165 -rm -f ../dds2tar archive_length
166 cd .. ; ln -s $(D) dds2tar
168 cd .. ; tar zfc ${T}.1.tar.gz --totals ${T}.1
169 cd .. ; tar cf archive.tar ${D}.lsm ${D}.tar.gz ${T}.1.tar.gz
171 tar-patch tar-1.13.patch:
173 cd ..; diff -ru ${T} ${T}.1 |grep -v 'Only in '> $(D)/${T}.patch ;true
177 $(CC) -c $< $(CCOPT) $(CCFLAGS)
180 $(CC) -S -c $< $(CCOPT) $(CCFLAGS)
183 umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$@
186 umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$*.1
187 umask 022 ; groff -man $*.$(MANEXT) > $*.ps
190 -rm -f $(OBJ) dds2tar.o dds2index.o mt-dds.o dds-dd.o *.BAK *.s
191 -rm -f dds2tar dds2index mt-dds dds-dd fio_test
192 -rm -f *~ *.$(MANEXT) *.ps
197 a2ps -p -nP [A-Z]* *.h *.c *.lsm > a.ps
198 man dds2tar | a2ps -p -nP -m -Hdds2tar > b.ps
199 man dds2index | a2ps -p -nP -m -Hdds2index > c.ps
200 man mt-dds | a2ps -p -nP -m -Hmt-dds.man.ps > d.ps
201 man dds-dd | a2ps -p -nP -m -Hdds-dd.man.ps > d.ps
203 psman: dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
204 groff -man dds2tar.$(MANEXT) > dds2tar.ps
205 groff -man dds2index.$(MANEXT) > dds2index.ps
206 groff -man mt-dds.$(MANEXT) > mt-dds.ps
207 groff -man dds-dd.$(MANEXT) > dds-dd.ps
209 dds_quote.o:dds_quote.c dds2tar.h
210 dds_extract.o:dds_extract.c dds2tar.h dds_tape.h
211 dds_index.o:dds_index.c dds2tar.h dds_tape.h
212 dds_quote.o:dds_quote.c dds2tar.h
213 dds_tape.o:dds_tape.c dds2tar.h dds_tape.h
214 zf-cre-open.o:zf-cre-open.c zf-cre-open.h
216 INC=dds2tar.h dds_tape.h zf-cre-open.h
217 dds2tar.o:dds2tar.c $(INC)
218 $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2TAR -o dds2tar.o
219 dds2index.o:dds2tar.c $(INC)
220 $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2INDEX -o dds2index.o
221 mt-dds.o:dds2tar.c $(INC)
222 $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o mt-dds.o
223 dds-dd.o:dds2tar.c $(INC)
224 $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o dds-dd.o
226 fio_test:zf-cre-open.c zf-cre-open.h
227 cc zf-cre-open.c -DTEST -o fio_test