Makefile 3.6 KB

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