1 # Makefile for GNU tar program.
5 # In order to disable remote-tape support, add -DNO_REMOTE to the
6 # appropriate DEFS line, and remove rtape_lib.* from LOCAL_{SRC,OBJ}
7 # For Ultrix 3.1, you will have to compile rtape_lib.c with -DUSG.
8 # Add -DUSE_REXEC to use rexec for remote tape operations
9 # instead of forking rsh or remsh.
11 # If tar fails to properly print error msgs, or core-dumps doing same,
12 # you may need to change which version of msg...() you are using.
13 # To do so, add one of the following to your DEFS= line
14 # -DSTDC_MSG If you are using an ANSI compiler, and have vfprintf().
15 # -DVARARGS_MSG If you have varargs.h and vfprintf()
16 # -DDOPRNT_MSG If you have _doprnt(), and no useful varargs support
17 # -DLOSING_MSG If nothing else works.
19 # Some non-BSD systems may have to add -DNEED_TZSET in order to have getdate.y
22 # If you have a system V system which defines size_t, add -DHAVE_SIZE_T.
23 # If you have a system which defines strstr, add -DHAVE_STRSTR.
25 # If you can't use remote tar with the rmt library, you can still get
26 # some stuff to work right by adding -DUSE_REXEC.
28 # Some people's systems define a prototype for signal handlers which
29 # require them to be declared as void. If you get such problems in
30 # rtape_lib, function command, then define -DSIGNAL_VOID.
32 # getdate.y has 8 shift/reduce conflicts.
34 # In addition to setting DEFS appropriately for your system, you might
35 # have to hand edit the #defines and #undefs in port.c.
50 ## Berserkeley version
52 DEFS = -DBSD42 -DSTDC_MSG -DNEED_TZSET -DUSE_REXEC
54 LOCAL_OBJ = getdate.$O
59 DEF_AR_FILE = \"/dev/rmt8\"
65 #DEFS = -DBSD42 -DSIGNAL_VOID
66 #LOCAL_SRC = getdate.y rtape_lib.c
67 #LOCAL_OBJ = getdate.$O rtape_lib.$O
72 #DEF_AR_FILE = \"/dev/rmt8\"
77 #DEFS = -DBSD42 -Dhpux -DVARARGS_MSG
78 #LOCAL_SRC = getdate.y rtape_lib.c
79 #LOCAL_OBJ = getdate.$O rtape_lib.$O alloca.$O
84 #DEF_AR_FILE = \"/dev/rct/c3d0s2\"
88 # IBM AIX version -- this saves "hidden" directories, but doesn't restore
89 # them as hidden. Add -Di386 for a PS/2. If you don't have GCC, turn it off.
90 # Some people think you need -lbsd, some don't. Dunno.
92 #DEFS= -DUSG -Daix -DSTDC_MSG -DHAVE_MTIO -DHAVE_SIZE_T -DSIGNAL_VOID
93 #LOCAL_SRC = getdate.y rtape_lib.c
94 #LOCAL_OBJ = getdate.$O rtape_lib.$O
99 #DEF_AR_FILE = \"/dev/rmt0\"
104 # Add -DNDIR to DEFS if your system uses ndir.h instead of dirent.h
105 # Add -DDIRECT to DEFS if your system uses 'struct direct' instead of
106 # 'struct dirent' (this is the case at least with one add-on ndir
108 # Add -DHAVE_MTIO to DEFS if your system has sys/mtio.h and defines MTIOCTOP
109 # Add -DDAYLIGHT_MISSING to DEFS if your system doesn't define the
110 # external variable `daylight'.
111 # Add -lndir to LIBS if your ndir routines aren't in libc.a
112 # Add -lPW to LIBS if you don't compile with gcc (to get alloca)
113 #DEFS = -DUSG -DSIGNAL_VOID #-DNDIR -DDIRECT -DHAVE_MTIO
114 #LOCAL_SRC = getdate.y rtape_lib.c
115 #LOCAL_OBJ = getdate.$O rtape_lib.$O
120 #DEF_AR_FILE = \"/dev/rmt8\"
124 # UniSoft's Uniplus SVR2 with NFS
125 #DEFS = -DUSG -DUNIPLUS -DNFS -DSVR2 -DSIGNAL_VOID
126 #LOCAL_SRC = getdate.y rtape_lib.c
127 #LOCAL_OBJ = getdate.$O rtape_lib.$O
132 #DEF_AR_FILE = \"/dev/rmt8\"
139 #LOCAL_SRC = getdate.y rtape_lib.c
140 #LOCAL_OBJ = getdate.$O rtape_lib.$O
145 #DEF_AR_FILE = \"/dev/rmt0\"
149 # (yuk) MS-DOS (Microsoft C 4.0) version
151 #DEFS = -DNONAMES -A$(MODEL) -DNO_REMOTE
152 #LOCAL_SRC = getdate.y rtape_lib.c
153 #LOCAL_OBJ = getdate.$O rtape_lib.$O
155 #LIBS = $(MODEL)dir.lib
158 #DEF_AR_FILE = \"tar.out\"
163 # Pick open3 emulation or nonexistence. See open3.h, port.c.
164 ##DEFS = -DV7 -DEMUL_OPEN3 -Dvoid=int
165 ##DEFS = -DV7 -DNO_OPEN3 -Dvoid=int
166 #LOCAL_SRC = getdate.y rtape_lib.c
167 #LOCAL_OBJ = getdate.$O rtape_lib.$O
172 #DEF_AR_FILE = \"/dev/rmt8\"
177 # No lint, so no lintflags. Default file is stdin/out. (Minix "tar"
178 # doesn't even take an "f" flag, it assumes argv[2] is the archive name!)
179 # Minix "make" doesn't expand macros right, so Minix users will have
180 # to expand CFLAGS, SRCS, O, etc by hand, or fix your make. Not my problem!
181 # You'll also need to come up with ctime(), the directory
182 # library, and a fixed doprintf() that handles %*s. Put this stuff in
183 # the "SUBSRC/SUBOBJ" macro below if you didn't put it in your C library.
184 # Note that Minix "cc" produces ".s" files, not .o's, so O = s has been set.
186 # Pick open3 emulation or nonexistence. See open3.h, port.c.
187 ##DEFS = -DV7 -DMINIX -DEMUL_OPEN3
188 ##DEFS = -DV7 -DMINIX -DNO_OPEN3
189 #LOCAL_SRC = getdate.y rtape_lib.c
190 #LOCAL_OBJ = getdate.$O rtape_lib.$O
194 #DEFBLOCKING = 8 # No good reason for this, change at will
198 #DEFS = -DUSG -DXENIX -DSIGNAL_VOID
199 #LOCAL_SRC = getdate.y rtape_lib.c
200 #LOCAL_OBJ = getdate.$O rtape_lib.$O
205 #DEF_AR_FILE = \"/dev/rmt8\"
210 # You will need to define NEED_TZSET in getdate.y
211 #DEFS = -DUSG -I/usr/include/bsd
212 #LOCAL_SRC = getdate.y rtape_lib.c
213 #LOCAL_OBJ = getdate.$O rtape_lib.$O
218 #DEF_AR_FILE = \"/dev/tape\"
225 CFLAGS = $(COPTS) $(ALLDEFS)
227 -DDEF_AR_FILE=$(DEF_AR_FILE) \
228 -DDEFBLOCKING=$(DEFBLOCKING)
229 # next line for Debugging
231 # next line for Production
234 # Add things here like readdir that aren't in your standard libraries.
235 # (E.g. MSDOS needs msd_dir.c, msd_dir.obj)
239 # Destination directory and installation program for make install
240 bindir = /usr/local/gnubin
244 SRC1 = tar.c create.c extract.c buffer.c getoldopt.c update.c gnu.c mangle.c
245 SRC2 = version.c list.c names.c diffarch.c port.c wildmat.c getopt.c getopt1.c regex.c
246 SRC3 = $(LOCAL_SRC) $(SUBSRC)
247 SRCS = $(SRC1) $(SRC2) $(SRC3)
248 OBJ1 = tar.$O create.$O extract.$O buffer.$O getoldopt.$O list.$O update.$O
249 OBJ2 = version.$O names.$O diffarch.$O port.$O wildmat.$O getopt.$O getopt1.$O regex.$O
250 OBJ3 = gnu.$O mangle.$O $(LOCAL_OBJ) $(SUBOBJ)
251 OBJS = $(OBJ1) $(OBJ2) $(OBJ3)
252 # AUX = README PORTING Makefile TODO tar.h port.h open3.h \
253 # msd_dir.h msd_dir.c
254 AUX = README COPYING ChangeLog Makefile tar.texinfo tar.h port.h open3.h \
255 rmt.h msd_dir.h msd_dir.c rtape_server.c rtape_lib.c getdate.y \
256 getopt.h regex.h level-0 level-1 backup-specs testpad.c
261 $(CC) $(LDFLAGS) -o tar $(COPTS) $(OBJS) $(LIBS)
264 $(CC) $(CFLAGS) $(LDFLAGS) -o rmt rtape_server.c
270 $(CC) -o testpad testpad.o
272 # command is too long for Messy-Dos (128 char line length limit) so
273 # this kludge is used...
274 # @echo $(OBJ1) + > command
275 # @echo $(OBJ2) >> command
276 # link @command, $@,,$(LIBS) /NOI;
281 $(INSTALL) tar $(bindir)/tar
282 $(INSTALL) rmt /etc/rmt
285 $(LINT) $(LINTFLAGS) $(ALLDEFS) $(SRCS)
291 $(RM) errs $(OBJS) tar rmt testpad.o testpad testpad.h
298 shar $(SRCS) $(AUX) | compress > tar-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c`.shar.Z
300 dist: $(SRC1) $(SRC2) $(AUX)
301 echo tar-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
304 ln $(SRC1) $(SRC2) $(AUX) `cat .fname`
305 tar chZf `cat .fname`.tar.Z `cat .fname`
306 -rm -rf `cat .fname` .fname
308 tar.zoo: $(SRCS) $(AUX)
311 for X in $(SRCS) $(AUX) ; do echo $$X ; sed 's/$$/
\r/' $$X > tmp.dir/$$X ; done
312 cd tmp.dir ; zoo aM ../tar.zoo *
315 $(OBJS): tar.h port.h testpad.h
316 regex.$O tar.$O: regex.h