home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gtak212.zip / 1.10 / makefile.os2 < prev    next >
Makefile  |  1992-09-29  |  11KB  |  355 lines

  1. ###############################################################################
  2. # $Id: makefile.os2,v 1.3 1992/09/29 09:55:53 ak Exp $
  3. ###############################################################################
  4. # $Log: makefile.os2,v $
  5. # Revision 1.3  1992/09/29  09:55:53  ak
  6. # K.U.R., once again :-)
  7. # - removed a dup() in buffer.c
  8. # - EMX opendir with hidden/system test in gnu.c (...dotdot)
  9. #
  10. # Revision 1.2  1992/09/18  16:43:30  ak
  11. # *** empty log message ***
  12. #
  13. # Revision 1.1  1992/09/18  08:59:09  ak
  14. # Initial revision
  15. #
  16. ###############################################################################
  17.  
  18. # Makefile for GNU tar program.
  19.  
  20. # In order to disable remote-tape support, add -DNO_REMOTE to the
  21. # appropriate DEFS line, and remove rtape_lib.* from LOCAL_{SRC,OBJ}
  22. # For Ultrix 3.1, you will have to compile rtape_lib.c with -DUSG.
  23. # Add -DUSE_REXEC to use rexec for remote tape operations
  24. # instead of forking rsh or remsh.
  25. #
  26. # If tar fails to properly print error msgs, or core-dumps doing same,
  27. # you may need to change which version of msg...() you are using.
  28. # To do so, add one of the following to your DEFS= line
  29. # -DSTDC_MSG        If you are using an ANSI compiler, and have vfprintf().
  30. # -DVARARGS_MSG        If you have varargs.h and vfprintf()
  31. # -DDOPRNT_MSG        If you have _doprnt(), and no useful varargs support
  32. # -DLOSING_MSG        If nothing else works.
  33. #
  34. # Some non-BSD systems may have to add -DNEED_TZSET in order to have getdate.y
  35. # compile correctly.
  36. #
  37. # If you have a system V system which defines size_t, add -DHAVE_SIZE_T.
  38. # If you have a system which defines strstr, add -DHAVE_STRSTR.
  39. #
  40. # If you can't use remote tar with the rmt library, you can still get
  41. # some stuff to work right by adding -DUSE_REXEC.
  42. #
  43. # Some people's systems define a prototype for signal handlers which
  44. # require them to be declared as void.  If you get such problems in
  45. # rtape_lib, function command, then define -DSIGNAL_VOID.  
  46. #
  47. # getdate.y has 8 shift/reduce conflicts.
  48. #
  49. # In addition to setting DEFS appropriately for your system, you might
  50. # have to hand edit the #defines and #undefs in port.c.
  51.  
  52. INCLUDE = -I. -I../tape -I../libx
  53. bindir = $(ROOTDIR)/usr/bin32
  54.  
  55. ## GTAK version, emx-0.8e
  56.  
  57. usage:
  58.     @echo "Make target: release or debug"
  59. release:
  60.     $(MAKE) -f Makefile.os2 all CC="gcc -O -Zomf" LDFLAGS="-Zsys" O="obj"
  61. debug:
  62.     $(MAKE) -f Makefile.os2 all CC="gcc -g" LDFLAGS="" O="o"
  63.  
  64. DEFS = -DMSDOS -DNONAMES -DOS2=2 -DTAPE_IO $(INCLUDE)
  65. LOCAL_SRC = ak_dir.c ak_tape.c tape.c scsitape.c errtab.c \
  66.         inherit.c os2ea_ld.c dosname.c
  67. LOCAL_OBJ = ak_dir.$O ak_tape.$O tape.$O scsitape.$O errtab.$O getdate.$O \
  68.         inherit.$O os2ea_ld.$O dosname.$O
  69. LIBS = -los2 tar.def
  70. LINT = lint
  71. LINTFLAGS = -abchx
  72. DEFBLOCKING = 20
  73.  
  74. ## Berserkeley version
  75. #CC=gcc
  76. #DEFS = -DBSD42
  77. #LOCAL_SRC = getdate.y  rtape_lib.c
  78. #LOCAL_OBJ = getdate.$O rtape_lib.$O
  79. #LDFLAGS =
  80. #LIBS =
  81. #LINT = lint
  82. #LINTFLAGS = -abchx
  83. #DEF_AR_FILE = \"/dev/rmt8\"
  84. #DEFBLOCKING = 20
  85. #O = o
  86.  
  87. ## Ultrix
  88. #CC=gcc
  89. #DEFS = -DBSD42 -DSIGNAL_VOID
  90. #LOCAL_SRC = getdate.y  rtape_lib.c
  91. #LOCAL_OBJ = getdate.$O rtape_lib.$O
  92. #LDFLAGS =
  93. #LIBS =
  94. #LINT = lint
  95. #LINTFLAGS = -abchx
  96. #DEF_AR_FILE = \"/dev/rmt8\"
  97. #DEFBLOCKING = 20
  98. #O = o
  99.  
  100. # HPUX 7.0 version
  101. #DEFS = -DBSD42 -Dhpux -DVARARGS_MSG
  102. #LOCAL_SRC = getdate.y  rtape_lib.c 
  103. #LOCAL_OBJ = getdate.$O rtape_lib.$O alloca.$O
  104. #LDFLAGS =
  105. #LIBS = -lBSD 
  106. #LINT = lint
  107. #LINTFLAGS = -abchx
  108. #DEF_AR_FILE = \"/dev/rct/c3d0s2\"
  109. #DEFBLOCKING = 20
  110. #O = o
  111.  
  112. # IBM AIX version -- this saves "hidden" directories, but doesn't restore
  113. # them as hidden.  Add -Di386 for a PS/2.  If you don't have GCC, turn it off.
  114. # Some people think you need -lbsd, some don't.  Dunno.
  115. #CC=gcc
  116. #DEFS= -DUSG -Daix -DSTDC_MSG -DHAVE_MTIO -DHAVE_SIZE_T -DSIGNAL_VOID
  117. #LOCAL_SRC =  getdate.y rtape_lib.c
  118. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  119. #LDFLAGS =
  120. #LIBS = -lbsd
  121. #LINT = lint
  122. #LINTFLAGS = -p
  123. #DEF_AR_FILE = \"/dev/rmt0\"
  124. #DEFBLOCKING = 20
  125. #O = o
  126.  
  127. # USG version
  128. # Add -DNDIR to DEFS if your system uses ndir.h instead of dirent.h
  129. # Add -DDIRECT to DEFS if your system uses 'struct direct' instead of
  130. # 'struct dirent' (this is the case at least with one add-on ndir 
  131. # library)
  132. # Add -DHAVE_MTIO to DEFS if your system has sys/mtio.h and defines MTIOCTOP
  133. # Add -DDAYLIGHT_MISSING to DEFS if your system doesn't define the
  134. # external variable `daylight'.
  135. # Add -lndir to LIBS if your ndir routines aren't in libc.a
  136. # Add -lPW to LIBS if you don't compile with gcc (to get alloca)
  137. #DEFS = -DUSG -DSIGNAL_VOID #-DNDIR -DDIRECT -DHAVE_MTIO
  138. #LOCAL_SRC =  getdate.y rtape_lib.c
  139. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  140. #LDFLAGS =
  141. #LIBS = #-lndir -lPW
  142. #LINT = lint
  143. #LINTFLAGS = -p
  144. #DEF_AR_FILE = \"/dev/rmt8\"
  145. #DEFBLOCKING = 20
  146. #O = o
  147.  
  148. # UniSoft's Uniplus SVR2 with NFS
  149. #DEFS = -DUSG -DUNIPLUS -DNFS -DSVR2 -DSIGNAL_VOID
  150. #LOCAL_SRC =  getdate.y rtape_lib.c
  151. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  152. #LDFLAGS =
  153. #LIBS = -lndir
  154. #LINT = lint
  155. #LINTFLAGS = -bx
  156. #DEF_AR_FILE = \"/dev/rmt8\"
  157. #DEFBLOCKING = 20
  158. #O = o
  159.  
  160. # MASSCOMP version
  161. #CC = ucb cc
  162. #DEFS = -DBSD42
  163. #LOCAL_SRC =  getdate.y rtape_lib.c
  164. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  165. #LDFLAGS =
  166. #LIBS = 
  167. #LINT = lint
  168. #LINTFLAGS = -bx
  169. #DEF_AR_FILE = \"/dev/rmt0\"
  170. #DEFBLOCKING = 20
  171. #O = o
  172.  
  173. # (yuk) MS-DOS (Microsoft C 4.0) version
  174. #MODEL = S
  175. #DEFS = -DNONAMES -A$(MODEL) -DNO_REMOTE
  176. #LOCAL_SRC =  getdate.y rtape_lib.c
  177. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  178. #LDFLAGS =
  179. #LIBS = $(MODEL)dir.lib
  180. #LINT =    $(CC)
  181. #LINTFLAGS = -W3
  182. #DEF_AR_FILE = \"tar.out\"
  183. #DEFBLOCKING = 20
  184. #O = obj
  185.  
  186. # V7 version
  187. # Pick open3 emulation or nonexistence.  See open3.h, port.c.
  188. ##DEFS = -DV7 -DEMUL_OPEN3 -Dvoid=int
  189. ##DEFS = -DV7 -DNO_OPEN3 -Dvoid=int
  190. #LOCAL_SRC =  getdate.y rtape_lib.c
  191. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  192. #LDFLAGS =
  193. #LIBS = -lndir
  194. #LINT = lint
  195. #LINTFLAGS = -abchx
  196. #DEF_AR_FILE = \"/dev/rmt8\"
  197. #DEFBLOCKING = 20
  198. #O = o
  199.  
  200. # Minix version
  201. # No lint, so no lintflags.  Default file is stdin/out.  (Minix "tar"
  202. # doesn't even take an "f" flag, it assumes argv[2] is the archive name!)
  203. # Minix "make" doesn't expand macros right, so Minix users will have
  204. # to expand CFLAGS, SRCS, O, etc by hand, or fix your make.  Not my problem!
  205. # You'll also need to come up with ctime(), the directory
  206. # library, and a fixed doprintf() that handles %*s.  Put this stuff in
  207. # the "SUBSRC/SUBOBJ" macro below if you didn't put it in your C library.
  208. # Note that Minix "cc" produces ".s" files, not .o's, so O = s has been set.
  209. #
  210. # Pick open3 emulation or nonexistence.  See open3.h, port.c.
  211. ##DEFS = -DV7 -DMINIX -DEMUL_OPEN3
  212. ##DEFS = -DV7 -DMINIX -DNO_OPEN3
  213. #LOCAL_SRC =  getdate.y rtape_lib.c
  214. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  215. #LDFLAGS =
  216. #LIBS =
  217. #DEF_AR_FILE = \"-\"
  218. #DEFBLOCKING = 8    # No good reason for this, change at will
  219. #O = s
  220.  
  221. # Xenix version
  222. #DEFS = -DUSG -DXENIX -DSIGNAL_VOID
  223. #LOCAL_SRC =  getdate.y rtape_lib.c
  224. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  225. #LDFLAGS = 
  226. #LIBS = -lx
  227. #LINT = lint
  228. #LINTFLAGS = -p
  229. #DEF_AR_FILE = \"/dev/rmt8\"
  230. #DEFBLOCKING = 20
  231. #O = o
  232.  
  233. # SGI 4D version
  234. # You will need to define NEED_TZSET in getdate.y
  235. #DEFS = -DUSG -I/usr/include/bsd
  236. #LOCAL_SRC = getdate.y rtape_lib.c
  237. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  238. #LDFLAGS = 
  239. #LIBS = -lxmalloc
  240. #LINT = lint
  241. #LINTFLAGS = -p
  242. #DEF_AR_FILE = \"/dev/tape\"
  243. #DEFBLOCKING = 20
  244. #O = o
  245.  
  246. #CC = gcc
  247. #TARGET_ARCH = 
  248.  
  249. CFLAGS = $(ALLDEFS)
  250. ALLDEFS = $(DEFS) \
  251.     -DDEFBLOCKING=$(DEFBLOCKING)
  252. ##AK    -DDEF_AR_FILE=$(DEF_AR_FILE)
  253.  
  254. # Add things here like readdir that aren't in your standard libraries.
  255. # (E.g. MSDOS needs msd_dir.c, msd_dir.obj)
  256. SUBSRC=
  257. SUBOBJ=    
  258.  
  259. # Destination directory and installation program for make install
  260. INSTALL = cp
  261. RM = rm
  262.  
  263. SRC1 =    tar.c create.c extract.c buffer.c getoldop.c update.c gnu.c mangle.c
  264. SRC2 =  version.c list.c names.c diffarch.c port.c wildmat.c getopt.c getopt1.c
  265. SRC3 =  $(LOCAL_SRC) $(SUBSRC)
  266. SRCS =    $(SRC1) $(SRC2) $(SRC3)
  267. OBJ1 =    tar.$O create.$O extract.$O buffer.$O getoldop.$O list.$O update.$O
  268. OBJ2 =    version.$O names.$O diffarch.$O port.$O wildmat.$O getopt.$O getopt1.$O
  269. OBJ3 =  gnu.$O mangle.$O $(LOCAL_OBJ) $(SUBOBJ)
  270. OBJS =    $(OBJ1) $(OBJ2) $(OBJ3)
  271. # AUX =    README PORTING Makefile TODO tar.h port.h open3.h \
  272. #    msd_dir.h msd_dir.c
  273. AUX =   README COPYING ChangeLog Makefile tar.texinfo tar.h port.h open3.h \
  274.     rmt.h msd_dir.h msd_dir.c rtape_server.c rtape_lib.c getdate.y \
  275.     getopt.h regex.h level-0 level-1 backup-specs testpad.c
  276.  
  277. .c.$O:
  278.     $(CC) $(CFLAGS) -c $<
  279.  
  280. all:    tar$E
  281.  
  282. tar$E:    $(OBJS)
  283.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  284.  
  285. rmt$E:    rtape_server.c
  286.     $(CC) $(CFLAGS) $(LDFLAGS) -o rmt rtape_server.c
  287.  
  288. #testpad.h: testpad$E
  289. #    testpad > testpad.h
  290.  
  291. testpad$E: testpad.o
  292.     $(CC) -o $@ testpad.o
  293.  
  294. # command is too long for Messy-Dos (128 char line length limit) so
  295. # this kludge is used...
  296. #    @echo $(OBJ1) + > command
  297. #    @echo $(OBJ2) >> command
  298. #    link @command, $@,,$(LIBS) /NOI;
  299. #    @$(RM) command
  300.  
  301. install: all
  302.     $(RM) $(bindir)/tar$E
  303.     $(INSTALL) tar$E $(bindir)/
  304.  
  305. lint:    $(SRCS)
  306.     $(LINT) $(LINTFLAGS) $(ALLDEFS) $(SRCS)
  307.  
  308. TAGS:    $(SRCS)
  309.     etags $(SRCS)
  310.  
  311. clean:
  312.     $(RM) errs $(OBJS) tar rmt testpad.o testpad testpad.h
  313.  
  314. distclean: clean
  315.  
  316. realclean: clean
  317.  
  318. shar: $(SRCS) $(AUX)
  319.     shar $(SRCS) $(AUX) | compress > tar-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c`.shar.Z
  320.  
  321. dist: $(SRC1) $(SRC2) $(AUX)
  322.     echo tar-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
  323.     -rm -rf `cat .fname`
  324.     mkdir `cat .fname`
  325.     ln $(SRC1) $(SRC2) $(AUX) `cat .fname`
  326.     tar chZf `cat .fname`.tar.Z `cat .fname`
  327.     -rm -rf `cat .fname` .fname
  328.  
  329. tar.zoo: $(SRCS) $(AUX)
  330.     -mkdir tmp.dir
  331.     -rm tar.zoo
  332.     for X in $(SRCS) $(AUX) ; do echo $$X ; sed 's/$$//' $$X > tmp.dir/$$X ; done
  333.     cd tmp.dir ; zoo aM ../tar.zoo *
  334.     -rmdir tmp.dir
  335.  
  336. $(OBJS): tar.h port.h testpad.h
  337. regex.$O tar.$O: regex.h
  338.  
  339. tape.$O: ../tape/tape.c
  340.     $(CC) $(CFLAGS) -o $@ -c $<
  341. scsitape.$O: ../tape/scsitape.c
  342.     $(CC) $(CFLAGS) -o $@ -c $<
  343. errtab.$O: ../tape/errtab.c
  344.     $(CC) $(CFLAGS) -o $@ -c $<
  345. dirent.$O: ../libx/dirent.c
  346.     $(CC) $(CFLAGS) -o $@ -c $<
  347. inherit.$O: ../libx/inherit.c
  348.     $(CC) $(CFLAGS) -o $@ -c $<
  349. os2ea_ld.$O: ../libx/os2ea_ld.c
  350.     $(CC) $(CFLAGS) -o $@ -c $<
  351. os2ea_op.$O: ../libx/os2ea_op.c
  352.     $(CC) $(CFLAGS) -o $@ -c $<
  353. dosname.$O: ../libx/dosname.c
  354.     $(CC) $(CFLAGS) -o $@ -c $<
  355.