2 |
- |
1 |
#
|
|
|
2 |
# PAX - read and write POSIX conformant tar and cpio archives
|
|
|
3 |
#
|
|
|
4 |
# Written by Mark H. Colburn (mark@jhereg.mn.org)
|
|
|
5 |
#
|
|
|
6 |
# $Id: Makefile,v 1.2 89/02/12 10:08:59 mark Exp $
|
|
|
7 |
#
|
|
|
8 |
|
|
|
9 |
#
|
|
|
10 |
# CONFIGURATION SECTION
|
|
|
11 |
#
|
|
|
12 |
# The following defines may need to be changed for each system which PAX
|
|
|
13 |
# is installed on. Please review these settings before installing on your
|
|
|
14 |
# system.
|
|
|
15 |
|
|
|
16 |
#
|
|
|
17 |
# You should define _POSIX_SOURCE if you are running on a POSIX system. This
|
|
|
18 |
# include has to be in the command line because it has to appear before any
|
|
|
19 |
# include file is included in the source. For most systems in use today,
|
|
|
20 |
# it should be left blank.
|
|
|
21 |
#
|
|
|
22 |
# POSIX= -D_POSIX_SOURCE
|
|
|
23 |
POSIX=
|
|
|
24 |
|
|
|
25 |
#
|
|
|
26 |
# Set CFLAGS to whatever makes your C compiler happy. Be sure to include
|
|
|
27 |
# the definition of $(POSIX) in the flag.
|
|
|
28 |
#
|
|
|
29 |
CFLAGS = -O $(POSIX)
|
|
|
30 |
CC = cc
|
|
|
31 |
|
|
|
32 |
#
|
|
|
33 |
# Set LIBS to any additional libraries that you need linked in with pax.
|
|
|
34 |
#
|
|
|
35 |
LIBS=
|
|
|
36 |
|
|
|
37 |
#
|
|
|
38 |
# Set LFLAGS to whatever makes your linker happy
|
|
|
39 |
#
|
|
|
40 |
#LDFLAGS = -s
|
|
|
41 |
LDFLAGS =
|
|
|
42 |
|
|
|
43 |
#
|
|
|
44 |
# Set COPY to the name of the command to use to copy pax to cpio and
|
|
|
45 |
# tar. Usually it is 'ln'.
|
|
|
46 |
#
|
|
|
47 |
COPY=ln
|
|
|
48 |
|
|
|
49 |
#
|
|
|
50 |
# Set LINTFLAGS to whatever makes your implementation of lint happy. If
|
|
|
51 |
# you don't undef __STDC__ and you have an ANSI C compiler, lint will choke
|
|
|
52 |
# on the function prototypes present in func.h.
|
|
|
53 |
#
|
|
|
54 |
LINTFLAGS = -U__STDC__ $(POSIX)
|
|
|
55 |
|
|
|
56 |
#
|
|
|
57 |
# BINDIR - points to the directory in which you want the final pax, tar and
|
|
|
58 |
# cpio binaries installed in.
|
|
|
59 |
#
|
|
|
60 |
BINDIR = /usr/local/bin
|
|
|
61 |
|
|
|
62 |
#
|
|
|
63 |
# MANDIR - specify the directory in which the man pages will be installed
|
|
|
64 |
#
|
|
|
65 |
MAN5 = /usr/man/man5
|
|
|
66 |
MAN1 = /usr/man/man1
|
|
|
67 |
MAN5EXT = 5
|
|
|
68 |
MAN1EXT = 1
|
|
|
69 |
|
|
|
70 |
#
|
|
|
71 |
# There are three different ways to get POSIX or BSD conformant directory
|
|
|
72 |
# access routines: 1) they are installed in your system library, 2) you
|
|
|
73 |
# are using Doug Gwyn's dirent library (/usr/lib/libdirent.a), or 3) you
|
|
|
74 |
# need the source for the dirent package. Based on that, pick one of the
|
|
|
75 |
# following three options:
|
|
|
76 |
#
|
|
|
77 |
# 1. Pick the first dirent line and make sure that config.h is defined
|
|
|
78 |
# correctly for your version of directory access routines. THIS IS
|
|
|
79 |
# THE LINE WHICH SHOULD BE USED FOR BSD SYSTEMS.
|
|
|
80 |
# 2. Chose the second dirent line which used a library at link time. You
|
|
|
81 |
# may need to change the name of the library to match your system.
|
|
|
82 |
# 3. If you need #3, then you must copy everything in the subdirectory dirent
|
|
|
83 |
# to this directory and choose the DIROBJ lines. Please note that this
|
|
|
84 |
# version of dirent has been modified to work as a stand-alone.
|
|
|
85 |
#
|
|
|
86 |
DIRENT=
|
|
|
87 |
#DIRENT= -ldirent
|
|
|
88 |
#DIROBJ= paxdir.o
|
|
|
89 |
|
|
|
90 |
#
|
|
|
91 |
# END CONFIGURATION SECTION
|
|
|
92 |
#
|
|
|
93 |
# Nothing beyond this point should need to be changed.
|
|
|
94 |
#
|
|
|
95 |
|
|
|
96 |
SHELL = /bin/sh
|
|
|
97 |
MISC = Makefile pax.1 tar.5 cpio.5 README PATCHLEVEL
|
|
|
98 |
HEADERS= config.h func.h limits.h port.h pax.h
|
|
|
99 |
SOURCE= pax.c append.c buffer.c cpio.c create.c extract.c fileio.c\
|
|
|
100 |
link.c list.c mem.c namelist.c names.c pass.c pathname.c\
|
|
|
101 |
port.c regexp.c replace.c tar.c ttyio.c warn.c wildmat.c
|
|
|
102 |
OBJECT= pax.o append.o buffer.o cpio.o create.o extract.o fileio.o\
|
|
|
103 |
link.o list.o mem.o namelist.o names.o pass.o pathname.o\
|
|
|
104 |
port.o regexp.o replace.o tar.o ttyio.o warn.o wildmat.o $(DIROBJ)
|
|
|
105 |
PROGS = pax tar cpio
|
|
|
106 |
PMAN1 = pax.1 tar.1
|
|
|
107 |
PMAN5 = pax.5 tar.5
|
|
|
108 |
|
|
|
109 |
all: $(PROGS)
|
|
|
110 |
|
|
|
111 |
install: $(PROGS)
|
|
|
112 |
strip pax
|
|
|
113 |
cp pax $(BINDIR)
|
|
|
114 |
chmod 755 $(BINDIR)/pax
|
|
|
115 |
ln $(BINDIR)/pax $(BINDIR)/tar
|
|
|
116 |
ln $(BINDIR)/pax $(BINDIR)/cpio
|
|
|
117 |
cp $(PMAN1) $(MAN1)
|
|
|
118 |
# cp $(PMAN5) $(MAN5)
|
|
|
119 |
|
|
|
120 |
clean:
|
|
|
121 |
rm -f $(OBJECT)
|
|
|
122 |
rm -f $(PROGS) a.out *.BAK *.bak
|
|
|
123 |
|
|
|
124 |
lint:
|
|
|
125 |
lint $(LINTFLAGS) $(SOURCE)
|
|
|
126 |
|
|
|
127 |
pax : $(OBJECT)
|
|
|
128 |
$(CC) $(CFLAGS) $(LDFLAGS) -o pax $(OBJECT) $(DIRENT) $(LIBS)
|
|
|
129 |
|
|
|
130 |
tar: pax
|
|
|
131 |
rm -f tar
|
|
|
132 |
$(COPY) pax tar
|
|
|
133 |
|
|
|
134 |
cpio: pax
|
|
|
135 |
rm -f cpio
|
|
|
136 |
$(COPY) pax cpio
|
|
|
137 |
|
|
|
138 |
$(OBJECT): $(HEADERS)
|