File: Makefile

package info (click to toggle)
dds2tar 2.5.2-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: ansic: 2,889; makefile: 593; sh: 213; csh: 50
file content (233 lines) | stat: -rw-r--r-- 6,474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Makefile for dds2tar
#
#--------------------------------------------------------
# To compile everything:                     make
# To install the executables and man pages:  make install
#--------------------------------------------------------

V=2.5.2

# Here are some configurable options:
################################################################

# To enable the use of the log pages of an HPDAT,
# uncomment the following line :
HPDAT=-DHPDAT

# Default tape device is: /dev/nst0
# edit or uncomment the following line to change the default device
DEVICE=/dev/nst0

# Enable trace mode -- for debugging only
# TRACE=-DDDS_TRACE=1

# The tape blocks are read into a buffer, so the buffer of dds2tar
# should be in the same size as the one in /usr/src/linux/driver/scsi/st.c
# of the kernel code. Set ST_BUFFER_BLOCKS to zero, in order to take the
# size from the kernel source directly.
#
# The number is halved, if EOVERFLOW is detected.
# The value of the kernel is normally ST_BUFFER_BLOCKS=32.
#
# To configure the buffer size of dds2tar
# change or uncomment the following line :
BUFFER=-DST_BUFFER_BLOCKS=32
# BUFFER=-DST_BUFFER_BLOCKS=0

# To include some experimental stuff
# uncomment the following line :
# EXP_STUFF=-DEXP_STUFF

# change this to where you want to install:
BINDIR=$(DESTDIR)/usr/bin
MANDIR=$(DESTDIR)/usr/share/man
MANEXT=1

# place here your favorite C compiler and options
CC=cc -g
CCOPT=$(HPDAT) $(HPDAT4) $(EXP_STUFF) $(MATCH) $(BUFFER) \
      -DDEVICE=\"$(DEVICE)\" -O4 -Wall $(TRACE) -D_GNU_SOURCE

#        -Wall \
#        -Wstrict-prototypes \
#        -Wshadow \
#        -Wwrite-strings \
#        -Wpointer-arith \
#        -Wcast-qual \
#        -Wenum-clash \
#        -Wcast-align \
#        -Wtraditional \
#        -Wmissing-prototypes \
#        -Wnested-externs \
#        -Winline \
#        -pedantic \
 

# nothing configurable below this line
################################################################

.SUFFIXES: .c .o .man .$(MANEXT) .ps .s

D=dds2tar-${V}

CCFLAGS=$(CFLAGS) -DVERSION=\"$V\"

TAR=tar
ARCHIVE=\
$(D)/Makefile \
$(D)/Changes \
$(D)/README \
$(D)/dds2tar.man \
$(D)/dds2index.man \
$(D)/mt-dds.man \
$(D)/dds-dd.man \
$(D)/dds2tar.ps \
$(D)/dds2index.ps \
$(D)/mt-dds.ps \
$(D)/dds-dd.ps \
$(D)/dds2tar.h \
$(D)/dds2tar.c \
$(D)/dds_extract.c \
$(D)/zf-cre-open.h \
$(D)/zf-cre-open.c \
$(D)/dds_index.c \
$(D)/dds_tape.h \
$(D)/dds_tape.c \
$(D)/dds_chkhdr.c \
$(D)/dds_quote.c \
$(D)/scsi_vendor \
$(D)/tar-1.11.2.patch \
$(D)/tar-1.11.8.patch \
$(D)/tar-1.12.patch \
$(D)/tar-1.13.patch \
$(D)/tar-1.11.2-sparse-files.patch \
$(D)/tar-1.11.2-sparse-files.README \
$(D)/dds2tar-test.sh \
$(D)/index-of-tar \
$(D)/index-of-tar-v \
$(D)/index-of-tar-t \
$(D)/index-of-dds2index \
$(D)/.indent.pro \
$(D)/dds2tar.lsm \
$(D)/COPYING \
$(D)/ddstool \


OBJ= dds_index.o dds_extract.o dds_tape.o dds_quote.o \
     zf-cre-open.o dds_chkhdr.o


all: dds2tar dds2tar.1 dds2index.1 mt-dds.1 dds-dd.1

dds2tar: dds2tar.o $(OBJ)
	$(CC) $(LDFLAGS) dds2tar.o $(OBJ)  -o dds2tar
	ln -f dds2tar dds2index
	ln -f dds2tar mt-dds
	ln -f dds2tar dds-dd

tar2tar: tar2tar.c
	$(CC) tar2tar.c -o tar2tar

dds2index: dds2index.o $(OBJ)
	$(CC) dds2index.o $(OBJ)  -o dds2index

mt-dds: mt-dds.o $(OBJ)
	$(CC) mt-dds.o $(OBJ)  -o mt-dds

dds-dd: dds-dd.o $(OBJ)
	$(CC) dds-dd.o $(OBJ)  -o dds-dd

install: dds2tar ddstool \
	dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
	mkdir -p $(BINDIR)
	mkdir -p $(MANDIR)
	install -c dds2tar $(BINDIR)
	install scsi_vendor $(BINDIR)
	install -c ddstool $(BINDIR)
	ls -l $(BINDIR)/dds2tar $(BINDIR)/ddstool
	install -c dds2tar.$(MANEXT)   $(MANDIR)/man$(MANEXT)
	install -c dds2index.$(MANEXT) $(MANDIR)/man$(MANEXT)
	install -c mt-dds.$(MANEXT)    $(MANDIR)/man$(MANEXT)
	install -c dds-dd.$(MANEXT)    $(MANDIR)/man$(MANEXT)
	ln -f $(BINDIR)/dds2tar  $(BINDIR)/dds2index
	ln -f $(BINDIR)/dds2tar  $(BINDIR)/mt-dds
	ln -f $(BINDIR)/dds2tar  $(BINDIR)/dds-dd

T=tar-1.13
tar: dds2tar.ps dds2index.ps mt-dds.ps dds-dd.ps ${T}.patch
	-cd .. ; echo ' ' ; \
		$(TAR) -R -c -f $(D).tar -v $(ARCHIVE) ;
		echo ' '
	ls -l ../$(D).tar
	gzip -9 -f ../$(D).tar
	ls -l ../$(D).tar.gz | awk '{print $$5}' > archive_length
	sed s/LENGTH/`cat archive_length`/ <dds2tar.lsm |\
           sed s/VERSION/$(V)/ > ../$(D).lsm
	ls -l ../dds2tar*z ../dds2tar*.lsm
	-rm -f ../dds2tar archive_length
	cd .. ; ln -s $(D) dds2tar
	echo ' '
	cd .. ; tar zfc ${T}.1.tar.gz --totals ${T}.1
	cd .. ; tar cf archive.tar ${D}.lsm ${D}.tar.gz ${T}.1.tar.gz

tar-patch tar-1.13.patch: 
	ls -l tar-*patch
	cd ..; diff -ru ${T} ${T}.1 |grep -v 'Only in '> $(D)/${T}.patch ;true
	ls -l tar-*patch

.c.o:
	$(CC) -c $< $(CCOPT) $(CCFLAGS)

.c.s:
	$(CC) -S -c $< $(CCOPT) $(CCFLAGS)

.man.1:
	umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$@

.man.ps:
	umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$*.1
	umask 022 ; groff -man $*.$(MANEXT)   > $*.ps

clean:
	-rm -f $(OBJ) dds2tar.o dds2index.o mt-dds.o dds-dd.o *.BAK *.s
	-rm -f dds2tar dds2index mt-dds dds-dd fio_test 
	-rm -f *~ *.$(MANEXT) *.ps
	-rm -f tags *.bak
#	chmod 644 *

doc:
	                a2ps -p -nP    [A-Z]* *.h *.c *.lsm > a.ps
	man dds2tar   | a2ps -p -nP -m -Hdds2tar            > b.ps
	man dds2index | a2ps -p -nP -m -Hdds2index          > c.ps
	man mt-dds    | a2ps -p -nP -m -Hmt-dds.man.ps      > d.ps
	man dds-dd    | a2ps -p -nP -m -Hdds-dd.man.ps      > d.ps

psman: dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
	groff -man dds2tar.$(MANEXT)   > dds2tar.ps
	groff -man dds2index.$(MANEXT) > dds2index.ps
	groff -man mt-dds.$(MANEXT)    > mt-dds.ps
	groff -man dds-dd.$(MANEXT)    > dds-dd.ps

dds_quote.o:dds_quote.c dds2tar.h
dds_extract.o:dds_extract.c dds2tar.h dds_tape.h
dds_index.o:dds_index.c dds2tar.h dds_tape.h
dds_quote.o:dds_quote.c dds2tar.h
dds_tape.o:dds_tape.c dds2tar.h dds_tape.h
zf-cre-open.o:zf-cre-open.c zf-cre-open.h

INC=dds2tar.h dds_tape.h zf-cre-open.h
dds2tar.o:dds2tar.c $(INC)
	$(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2TAR -o dds2tar.o
dds2index.o:dds2tar.c $(INC)
	$(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2INDEX -o dds2index.o
mt-dds.o:dds2tar.c $(INC)
	$(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o mt-dds.o
dds-dd.o:dds2tar.c $(INC)
	$(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o dds-dd.o

fio_test:zf-cre-open.c zf-cre-open.h
	cc zf-cre-open.c -DTEST -o fio_test

tags:
	ctags -stv *.c