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 23POSIX= 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# 29CFLAGS = -O $(POSIX) 30CC = cc 31 32# 33# Set LIBS to any additional libraries that you need linked in with pax. 34# 35LIBS= 36 37# 38# Set LFLAGS to whatever makes your linker happy 39# 40#LDFLAGS = -s 41LDFLAGS = 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# 47COPY=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# 54LINTFLAGS = -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# 60BINDIR = /usr/local/bin 61 62# 63# MANDIR - specify the directory in which the man pages will be installed 64# 65MAN5 = /usr/man/man5 66MAN1 = /usr/man/man1 67MAN5EXT = 5 68MAN1EXT = 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# 86DIRENT= 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 96SHELL = /bin/sh 97MISC = Makefile pax.1 tar.5 cpio.5 README PATCHLEVEL 98HEADERS= config.h func.h limits.h port.h pax.h 99SOURCE= 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 102OBJECT= 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) 105PROGS = pax tar cpio 106PMAN1 = pax.1 tar.1 107PMAN5 = pax.5 tar.5 108 109all: $(PROGS) 110 111install: $(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 120clean: 121 rm -f $(OBJECT) 122 rm -f $(PROGS) a.out *.BAK *.bak 123 124lint: 125 lint $(LINTFLAGS) $(SOURCE) 126 127pax : $(OBJECT) 128 $(CC) $(CFLAGS) $(LDFLAGS) -o pax $(OBJECT) $(DIRENT) $(LIBS) 129 130tar: pax 131 rm -f tar 132 $(COPY) pax tar 133 134cpio: pax 135 rm -f cpio 136 $(COPY) pax cpio 137 138$(OBJECT): $(HEADERS) 139