home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume27 / dmake / part36 < prev    next >
Encoding:
Text File  |  1992-01-29  |  40.0 KB  |  1,267 lines

  1. Newsgroups: comp.sources.misc
  2. From: dvadura@plg.waterloo.edu (Dennis Vadura)
  3. Subject:  v27i137:  dmake - dmake Version 3.8, Part36/41
  4. Message-ID: <1992Jan29.165106.1636@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5912b66844077232f11fff95925e0cc4
  6. Date: Wed, 29 Jan 1992 16:51:06 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
  10. Posting-number: Volume 27, Issue 137
  11. Archive-name: dmake/part36
  12. Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
  13. Supersedes: dmake: Volume 19, Issue 22-58
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. # this is dmake.shar.36 (part 36 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/unix/bsd43/vf/make.sh continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 36; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/unix/bsd43/vf/make.sh' &&
  34. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c
  35. mv stat.o objects
  36. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c
  37. mv expand.o objects
  38. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmstring.c
  39. mv dmstring.o objects
  40. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c
  41. mv hash.o objects
  42. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c
  43. mv dag.o objects
  44. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c
  45. mv dmake.o objects
  46. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c
  47. mv path.o objects
  48. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c
  49. mv imacs.o objects
  50. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c
  51. mv sysintf.o objects
  52. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c
  53. mv parse.o objects
  54. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c
  55. mv getinp.o objects
  56. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c
  57. mv quit.o objects
  58. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O state.c
  59. mv state.o objects
  60. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O basename.c
  61. mv basename.o objects
  62. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmdump.c
  63. mv dmdump.o objects
  64. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c
  65. mv macparse.o objects
  66. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c
  67. mv rulparse.o objects
  68. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c
  69. mv percent.o objects
  70. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O function.c
  71. mv function.o objects
  72. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c
  73. mv arlib.o objects
  74. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c
  75. mv dirbrk.o objects
  76. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c
  77. mv rmprq.o objects
  78. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c
  79. mv ruletab.o objects
  80. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/runargv.c
  81. mv runargv.o objects
  82. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c
  83. mv putenv.o objects
  84. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c
  85. mv tempnam.o objects
  86. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c
  87. mv utime.o objects
  88. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c
  89. mv setvbuf.o objects
  90. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c
  91. mv memcpy.o objects
  92. cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c
  93. mv vfprintf.o objects
  94. cc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/state.o objects/basename.o objects/dmdump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o objects/memcpy.o objects/vfprintf.o 
  95. cp unix/bsd43/vf/startup.mk startup.mk
  96. SHAR_EOF
  97. chmod 0640 dmake/unix/bsd43/vf/make.sh ||
  98. echo 'restore of dmake/unix/bsd43/vf/make.sh failed'
  99. Wc_c="`wc -c < 'dmake/unix/bsd43/vf/make.sh'`"
  100. test 3196 -eq "$Wc_c" ||
  101.     echo 'dmake/unix/bsd43/vf/make.sh: original size 3196, current size' "$Wc_c"
  102. rm -f _shar_wnt_.tmp
  103. fi
  104. # ============= dmake/unix/bsd43/vf/memcpy.c ==============
  105. if test -f 'dmake/unix/bsd43/vf/memcpy.c' -a X"$1" != X"-c"; then
  106.     echo 'x - skipping dmake/unix/bsd43/vf/memcpy.c (File already exists)'
  107.     rm -f _shar_wnt_.tmp
  108. else
  109. > _shar_wnt_.tmp
  110. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/memcpy.c' &&
  111. char *
  112. memcpy(t, f, n)
  113. register char *t, *f;
  114. register n;
  115. {
  116. X   register char *p = t;
  117. X
  118. X   while( --n >= 0 ) *t++ = *f++;
  119. X
  120. X   return (p);
  121. }
  122. SHAR_EOF
  123. chmod 0640 dmake/unix/bsd43/vf/memcpy.c ||
  124. echo 'restore of dmake/unix/bsd43/vf/memcpy.c failed'
  125. Wc_c="`wc -c < 'dmake/unix/bsd43/vf/memcpy.c'`"
  126. test 137 -eq "$Wc_c" ||
  127.     echo 'dmake/unix/bsd43/vf/memcpy.c: original size 137, current size' "$Wc_c"
  128. rm -f _shar_wnt_.tmp
  129. fi
  130. # ============= dmake/unix/bsd43/vf/public.h ==============
  131. if test -f 'dmake/unix/bsd43/vf/public.h' -a X"$1" != X"-c"; then
  132.     echo 'x - skipping dmake/unix/bsd43/vf/public.h (File already exists)'
  133.     rm -f _shar_wnt_.tmp
  134. else
  135. > _shar_wnt_.tmp
  136. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/public.h' &&
  137. /* RCS      -- $Header$
  138. -- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
  139. --
  140. -- SYNOPSIS -- Local functions exported to be visible by others.
  141. --
  142. -- DESCRIPTION
  143. --      This file is generated by 'genpub'.  Function declarations
  144. --      that appear in this file are extracted by 'genpub' from
  145. --      source files.  Any function in the source file whose definition
  146. --      appears like:
  147. --
  148. --          PUBLIC return_type
  149. --          function( arg_list );
  150. --          type_expr1 arg1;
  151. --          ...
  152. --
  153. --      has its definition extracted and a line of the form:
  154. --
  155. --          return_type function ANSI((type_expr1,type_expr2,...));
  156. --
  157. --      entered into the output file.
  158. --
  159. -- AUTHOR
  160. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  161. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  162. --
  163. -- COPYRIGHT
  164. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  165. -- 
  166. --      This program is free software; you can redistribute it and/or
  167. --      modify it under the terms of the GNU General Public License
  168. --      (version 1), as published by the Free Software Foundation, and
  169. --      found in the file 'LICENSE' included with this distribution.
  170. -- 
  171. --      This program is distributed in the hope that it will be useful,
  172. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  173. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  174. --      GNU General Public License for more details.
  175. -- 
  176. --      You should have received a copy of the GNU General Public License
  177. --      along with this program;  if not, write to the Free Software
  178. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  179. --
  180. -- LOG
  181. --     $Log$
  182. */
  183. X
  184. #ifndef _DMAKE_PUBLIC_h
  185. #define _DMAKE_PUBLIC_h
  186. X
  187. void Infer_recipe ANSI((CELLPTR, CELLPTR));
  188. int Make_targets ANSI(());
  189. int Exec_commands ANSI((CELLPTR));
  190. void Print_cmnd ANSI((char *, int, int));
  191. void Pop_dir ANSI((int));
  192. void Append_line ANSI((char *, int, FILE *, char *, int, int));
  193. void Stat_target ANSI((CELLPTR, int));
  194. char * Expand ANSI((char *));
  195. char * Apply_edit ANSI((char *, char *, char *, int, int));
  196. void Map_esc ANSI((char *));
  197. char* Apply_modifiers ANSI((int, char *));
  198. char* Tokenize ANSI((char *, char *));
  199. char * _strjoin ANSI((char *, char *, int, int));
  200. char * _stradd ANSI((char *, char *, int));
  201. char * _strapp ANSI((char *, char *));
  202. char * _strdup ANSI((char *));
  203. char * _strdup2 ANSI((char *));
  204. char * _strpbrk ANSI((char *, char *));
  205. char * _strspn ANSI((char *, char *));
  206. char * _strstr ANSI((char *, char *));
  207. char * _substr ANSI((char *, char *));
  208. uint16 Hash ANSI((char *, uint32 *));
  209. HASHPTR Get_name ANSI((char *, HASHPTR *, int));
  210. HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
  211. HASHPTR Def_macro ANSI((char *, char *, int));
  212. CELLPTR Def_cell ANSI((char *));
  213. LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
  214. void Clear_prerequisites ANSI((CELLPTR));
  215. int Test_circle ANSI((CELLPTR, int));
  216. STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
  217. t_attr Rcp_attribute ANSI((char *));
  218. int main ANSI((int, char **));
  219. FILE * Openfile ANSI((char *, int, int));
  220. FILE * Closefile ANSI(());
  221. FILE * Search_file ANSI((char *, char **));
  222. char * Filename ANSI(());
  223. int Nestlevel ANSI(());
  224. void No_ram ANSI(());
  225. int Usage ANSI((int));
  226. int Version ANSI(());
  227. char * Get_suffix ANSI((char *));
  228. char * Build_path ANSI((char *, char *));
  229. void Make_rules ANSI(());
  230. void Create_macro_vars ANSI(());
  231. time_t Do_stat ANSI((char *, char *, char **));
  232. int Do_touch ANSI((char *, char *, char **));
  233. void Void_lib_cache ANSI((char *, char *));
  234. time_t Do_time ANSI(());
  235. int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
  236. char ** Pack_argv ANSI((int, int, char *));
  237. char * Read_env_string ANSI((char *));
  238. int Write_env_string ANSI((char *, char *));
  239. void ReadEnvironment ANSI(());
  240. void Catch_signals ANSI((void (*)()));
  241. void Clear_signals ANSI(());
  242. void Prolog ANSI((int, char* []));
  243. void Epilog ANSI((int));
  244. char * Get_current_dir ANSI(());
  245. int Set_dir ANSI((char*));
  246. char Get_switch_char ANSI(());
  247. FILE* Get_temp ANSI((char **, char *, int));
  248. FILE * Start_temp ANSI((char *, CELLPTR, char **));
  249. void Open_temp_error ANSI((char *, char *));
  250. void Link_temp ANSI((CELLPTR, FILE *, char *));
  251. void Close_temp ANSI((CELLPTR, FILE *));
  252. void Unlink_temp_files ANSI((CELLPTR));
  253. void Handle_result ANSI((int, int, int, CELLPTR));
  254. void Update_time_stamp ANSI((CELLPTR));
  255. int Remove_file ANSI((char *));
  256. void Parse ANSI((FILE *));
  257. int Get_line ANSI((char *, FILE *));
  258. char * Do_comment ANSI((char *, char **, int));
  259. char * Get_token ANSI((TKSTRPTR, char *, int));
  260. void Quit ANSI(());
  261. void Read_state ANSI(());
  262. void Write_state ANSI(());
  263. int Check_state ANSI((CELLPTR, STRINGPTR *, int));
  264. char* basename ANSI((char *));
  265. void Dump ANSI(());
  266. void Dump_recipe ANSI((STRINGPTR));
  267. int Parse_macro ANSI((char *, int));
  268. int Macro_op ANSI((char *));
  269. int Parse_rule_def ANSI((int *));
  270. int Rule_op ANSI((char *));
  271. void Add_recipe_to_list ANSI((char *, int, int));
  272. void Bind_rules_to_targets ANSI((int));
  273. int Set_group_attributes ANSI((char *));
  274. DFALINKPTR Match_dfa ANSI((char *));
  275. void Check_circle_dfa ANSI(());
  276. void Add_nfa ANSI((char *));
  277. char * Exec_function ANSI((char *));
  278. time_t seek_arch ANSI((char *, char *));
  279. int If_root_path ANSI((char *));
  280. void Remove_prq ANSI((CELLPTR));
  281. int runargv ANSI((CELLPTR, int, int, int, int, char *));
  282. int Wait_for_child ANSI((int, int));
  283. void Clean_up_processes ANSI(());
  284. X
  285. #endif
  286. SHAR_EOF
  287. chmod 0640 dmake/unix/bsd43/vf/public.h ||
  288. echo 'restore of dmake/unix/bsd43/vf/public.h failed'
  289. Wc_c="`wc -c < 'dmake/unix/bsd43/vf/public.h'`"
  290. test 5448 -eq "$Wc_c" ||
  291.     echo 'dmake/unix/bsd43/vf/public.h: original size 5448, current size' "$Wc_c"
  292. rm -f _shar_wnt_.tmp
  293. fi
  294. # ============= dmake/unix/bsd43/vf/startup.mk ==============
  295. if test -f 'dmake/unix/bsd43/vf/startup.mk' -a X"$1" != X"-c"; then
  296.     echo 'x - skipping dmake/unix/bsd43/vf/startup.mk (File already exists)'
  297.     rm -f _shar_wnt_.tmp
  298. else
  299. > _shar_wnt_.tmp
  300. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/startup.mk' &&
  301. # Generic UNIX DMAKE startup file.  Customize to suit your needs.
  302. # Should work for both SYSV, and BSD 4.3
  303. # See the documentation for a description of internally defined macros.
  304. #
  305. # Disable warnings for macros redefined here that were given
  306. # on the command line.
  307. __.SILENT := $(.SILENT)
  308. .SILENT   := yes
  309. X
  310. # Configuration parameters for DMAKE startup.mk file
  311. # Set these to NON-NULL if you wish to turn the parameter on.
  312. _HAVE_RCS    := yes        # yes => RCS  is installed.
  313. _HAVE_SCCS    := yes        # yes => SCCS is installed.
  314. X
  315. # Applicable suffix definitions
  316. A := .a        # Libraries
  317. E :=        # Executables
  318. F := .f        # Fortran
  319. O := .o        # Objects
  320. P := .p        # Pascal
  321. S := .s        # Assembler sources
  322. V := ,v        # RCS suffix
  323. X
  324. # Recipe execution configurations
  325. SHELL        := /bin/sh
  326. SHELLFLAGS    := -ce
  327. GROUPSHELL    := $(SHELL)
  328. GROUPFLAGS    := 
  329. SHELLMETAS    := |();&<>?*][$$:\\#`'"
  330. GROUPSUFFIX    :=
  331. DIVFILE         = $(TMPFILE)
  332. X
  333. # Standard C-language command names and flags
  334. X   CPP       := /lib/cpp        # C-preprocessor
  335. X   CC      := cc        # C-compiler and flags
  336. X   CFLAGS  +=
  337. X
  338. X   AS      := as        # Assembler and flags
  339. X   ASFLAGS += 
  340. X
  341. X   LD       = $(CC)        # Loader and flags
  342. X   LDFLAGS +=
  343. X   LDLIBS   =
  344. X
  345. # Definition of $(MAKE) macro for recursive makes.
  346. X   MAKE = $(MAKECMD) $(MFLAGS)
  347. X
  348. # Definition of Print command for this system.
  349. X   PRINT = lpr
  350. X
  351. # Language and Parser generation Tools and their flags
  352. X   YACC      := yacc        # standard yacc
  353. X   YFLAGS +=
  354. X   YTAB      := y.tab        # yacc output files name stem.
  355. X
  356. X   LEX      := lex        # standard lex
  357. X   LFLAGS +=
  358. X   LEXYY  := lex.yy        # lex output file
  359. X
  360. # Other Compilers, Tools and their flags
  361. X   PC    := pc            # pascal compiler
  362. X   RC    := f77            # ratfor compiler
  363. X   FC    := f77            # fortran compiler
  364. X
  365. X   CO       := co        # check out for RCS
  366. X   COFLAGS += -q
  367. X
  368. X   AR     := ar            # archiver
  369. X   ARFLAGS+= ruv
  370. X
  371. X   RM       := /bin/rm        # remove a file command
  372. X   RMFLAGS +=
  373. X
  374. # Implicit generation rules for making inferences.
  375. # We don't provide .yr or .ye rules here.  They're obsolete.
  376. # Rules for making *$O
  377. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  378. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  379. X   %$O : %$S ; $(AS) $(ASFLAGS) $<
  380. X   %$O : %.cl ; class -c $<
  381. X   %$O : %.e %.r %.F %$F
  382. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  383. X
  384. # Executables
  385. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  386. X
  387. # lex and yacc rules
  388. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  389. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  390. X
  391. # This rule tells how to make *.out from it's immediate list of prerequisites
  392. # UNIX only.
  393. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  394. X
  395. # RCS support
  396. .IF $(_HAVE_RCS)
  397. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  398. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  399. .END
  400. X
  401. # SCCS support
  402. .IF $(_HAVE_SCCS)
  403. X   % : s.% ; get $<
  404. X   .NOINFER : s.%
  405. .END
  406. X
  407. # Recipe to make archive files.
  408. %$A :
  409. [
  410. X   $(AR) $(ARFLAGS) $@ $?
  411. X   $(RM) $(RMFLAGS) $?
  412. X   ranlib $@
  413. ]
  414. X
  415. # DMAKE uses this recipe to remove intermediate targets
  416. .REMOVE :; $(RM) -f $<
  417. X
  418. # AUGMAKE extensions for SYSV compatibility
  419. @B = $(@:b)
  420. @D = $(@:d)
  421. @F = $(@:f)
  422. "*B" = $(*:b)
  423. "*D" = $(*:d)
  424. "*F" = $(*:f)
  425. <B = $(<:b)
  426. <D = $(<:d)
  427. <F = $(<:f)
  428. ?B = $(?:b)
  429. ?F = $(?:f)
  430. ?D = $(?:d)
  431. X
  432. # Turn warnings back to previous setting.
  433. .SILENT := $(__.SILENT)
  434. X
  435. # Local startup file if any
  436. .INCLUDE .IGNORE: "_startup.mk"
  437. SHAR_EOF
  438. chmod 0640 dmake/unix/bsd43/vf/startup.mk ||
  439. echo 'restore of dmake/unix/bsd43/vf/startup.mk failed'
  440. Wc_c="`wc -c < 'dmake/unix/bsd43/vf/startup.mk'`"
  441. test 3227 -eq "$Wc_c" ||
  442.     echo 'dmake/unix/bsd43/vf/startup.mk: original size 3227, current size' "$Wc_c"
  443. rm -f _shar_wnt_.tmp
  444. fi
  445. # ============= dmake/unix/bsd43/vf/vfprintf.c ==============
  446. if test -f 'dmake/unix/bsd43/vf/vfprintf.c' -a X"$1" != X"-c"; then
  447.     echo 'x - skipping dmake/unix/bsd43/vf/vfprintf.c (File already exists)'
  448.     rm -f _shar_wnt_.tmp
  449. else
  450. > _shar_wnt_.tmp
  451. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/vfprintf.c' &&
  452. /*
  453. X * Copyright (c) 1988 Regents of the University of California.
  454. X * All rights reserved.
  455. X *
  456. X * Redistribution and use in source and binary forms are permitted
  457. X * provided that the above copyright notice and this paragraph are
  458. X * duplicated in all such forms and that any documentation,
  459. X * advertising materials, and other materials related to such
  460. X * distribution and use acknowledge that the software was developed
  461. X * by the University of California, Berkeley.  The name of the
  462. X * University may not be used to endorse or promote products derived
  463. X * from this software without specific prior written permission.
  464. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  465. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  466. X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  467. X */
  468. X
  469. #if defined(LIBC_SCCS) && !defined(lint)
  470. static char sccsid[] = "@(#)vfprintf.c    5.2 (Berkeley) 6/27/88";
  471. #endif /* LIBC_SCCS and not lint */
  472. X
  473. #include <stdio.h>
  474. #include <varargs.h>
  475. X
  476. int
  477. vfprintf(iop, fmt, ap)
  478. X    FILE *iop;
  479. X    char *fmt;
  480. X    va_list ap;
  481. {
  482. X    int len;
  483. X    char localbuf[BUFSIZ];
  484. X
  485. X    if (iop->_flag & _IONBF) {
  486. X        iop->_flag &= ~_IONBF;
  487. X        iop->_ptr = iop->_base = localbuf;
  488. X        len = _doprnt(fmt, ap, iop);
  489. X        (void) fflush(iop);
  490. X        iop->_flag |= _IONBF;
  491. X        iop->_base = NULL;
  492. X        iop->_bufsiz = 0;
  493. X        iop->_cnt = 0;
  494. X    } else
  495. X        len = _doprnt(fmt, ap, iop);
  496. X
  497. X    return (ferror(iop) ? EOF : len);
  498. }
  499. X
  500. SHAR_EOF
  501. chmod 0640 dmake/unix/bsd43/vf/vfprintf.c ||
  502. echo 'restore of dmake/unix/bsd43/vf/vfprintf.c failed'
  503. Wc_c="`wc -c < 'dmake/unix/bsd43/vf/vfprintf.c'`"
  504. test 1409 -eq "$Wc_c" ||
  505.     echo 'dmake/unix/bsd43/vf/vfprintf.c: original size 1409, current size' "$Wc_c"
  506. rm -f _shar_wnt_.tmp
  507. fi
  508. # ============= dmake/unix/coherent/config.h ==============
  509. if test ! -d 'dmake/unix/coherent'; then
  510.     mkdir 'dmake/unix/coherent'
  511. fi
  512. if test -f 'dmake/unix/coherent/config.h' -a X"$1" != X"-c"; then
  513.     echo 'x - skipping dmake/unix/coherent/config.h (File already exists)'
  514.     rm -f _shar_wnt_.tmp
  515. else
  516. > _shar_wnt_.tmp
  517. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/config.h' &&
  518. /*
  519. -- COHERENT config.h
  520. -- SYNOPSIS -- Configurarion include file.
  521. -- 
  522. -- DESCRIPTION
  523. --     There is one of these for each specific machine configuration.
  524. --    It can be used to further tweek the machine specific sources
  525. --    so that they compile.
  526. --
  527. -- AUTHOR
  528. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  529. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  530. --
  531. -- COPYRIGHT
  532. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  533. -- 
  534. --      This program is free software; you can redistribute it and/or
  535. --      modify it under the terms of the GNU General Public License
  536. --      (version 1), as published by the Free Software Foundation, and
  537. --      found in the file 'LICENSE' included with this distribution.
  538. -- 
  539. --      This program is distributed in the hope that it will be useful,
  540. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  541. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  542. --      GNU General Public License for more details.
  543. -- 
  544. --      You should have received a copy of the GNU General Public License
  545. --      along with this program;  if not, write to the Free Software
  546. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  547. --
  548. -- LOG
  549. --     $Log: config.h,v $
  550. X * Revision 1.1  1992/01/24  03:28:39  dvadura
  551. X * dmake Version 3.8, Initial revision
  552. X *
  553. */
  554. X
  555. /* define this for configurations that don't have the coreleft function
  556. X * so that the code compiles.  To my knowledge coreleft exists only on
  557. X * Turbo C, but it is needed here since the function is used in many debug
  558. X * macros. */
  559. #define coreleft() 0L
  560. X
  561. extern char *getcwd ();
  562. X
  563. /* Define setvbuf, SysV doesn't have one */
  564. #define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
  565. #define tzset settz
  566. X
  567. /* We don't care about CONST */
  568. #define CONST
  569. #define void int
  570. typedef paddr_t off_t;
  571. X
  572. /* options. . . */
  573. #define ASCARCH 0
  574. X
  575. /* a small problem with pointer to voids on some unix machines needs this */
  576. #define PVOID void *
  577. SHAR_EOF
  578. chmod 0640 dmake/unix/coherent/config.h ||
  579. echo 'restore of dmake/unix/coherent/config.h failed'
  580. Wc_c="`wc -c < 'dmake/unix/coherent/config.h'`"
  581. test 1972 -eq "$Wc_c" ||
  582.     echo 'dmake/unix/coherent/config.h: original size 1972, current size' "$Wc_c"
  583. rm -f _shar_wnt_.tmp
  584. fi
  585. # ============= dmake/unix/coherent/config.mk ==============
  586. if test -f 'dmake/unix/coherent/config.mk' -a X"$1" != X"-c"; then
  587.     echo 'x - skipping dmake/unix/coherent/config.mk (File already exists)'
  588.     rm -f _shar_wnt_.tmp
  589. else
  590. > _shar_wnt_.tmp
  591. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/config.mk' &&
  592. # This is the COHERENT configuration file for DMAKE
  593. #    It simply modifies the values of SRC, and checks to see if
  594. #    OSENVIRONMENT is defined.  If so it includes the appropriate
  595. #    config.mk file.
  596. #
  597. # It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  598. # directory.
  599. #
  600. osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  601. X
  602. # The following are required sources
  603. OSDSRC := vfprintf.c getcwd.c
  604. .IF $(OSDSRC)
  605. X   SRC    += $(OSDSRC)
  606. X   .SETDIR=$(osrdir) : $(OSDSRC)
  607. .END
  608. X
  609. .SOURCE.h : $(osrdir)
  610. X
  611. # Local configuration modifications for CFLAGS, there's local SysV includes
  612. # too.
  613. CFLAGS += -I$(osrdir)
  614. X
  615. # See if we modify anything in the lower levels.
  616. .IF $(OSENVIRONMENT) != $(NULL)
  617. X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
  618. .END
  619. SHAR_EOF
  620. chmod 0640 dmake/unix/coherent/config.mk ||
  621. echo 'restore of dmake/unix/coherent/config.mk failed'
  622. Wc_c="`wc -c < 'dmake/unix/coherent/config.mk'`"
  623. test 765 -eq "$Wc_c" ||
  624.     echo 'dmake/unix/coherent/config.mk: original size 765, current size' "$Wc_c"
  625. rm -f _shar_wnt_.tmp
  626. fi
  627. # ============= dmake/unix/coherent/getcwd.c ==============
  628. if test -f 'dmake/unix/coherent/getcwd.c' -a X"$1" != X"-c"; then
  629.     echo 'x - skipping dmake/unix/coherent/getcwd.c (File already exists)'
  630.     rm -f _shar_wnt_.tmp
  631. else
  632. > _shar_wnt_.tmp
  633. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/getcwd.c' &&
  634. #if __STDC__
  635. char *getcwd(char *buffer, int length)
  636. #else
  637. char *getcwd (buffer, length)
  638. char *buffer;
  639. int length;
  640. #endif
  641. {
  642. X  extern char *getwd();
  643. X
  644. X  char *dir;
  645. X  dir = getwd();
  646. X  if (dir)
  647. X  {
  648. X    strncpy(buffer,dir,length);
  649. X    return buffer;
  650. X  }
  651. X  else
  652. X  {
  653. X    *buffer = 0;
  654. X    return (char *) 0;
  655. X  }
  656. }
  657. X
  658. SHAR_EOF
  659. chmod 0640 dmake/unix/coherent/getcwd.c ||
  660. echo 'restore of dmake/unix/coherent/getcwd.c failed'
  661. Wc_c="`wc -c < 'dmake/unix/coherent/getcwd.c'`"
  662. test 306 -eq "$Wc_c" ||
  663.     echo 'dmake/unix/coherent/getcwd.c: original size 306, current size' "$Wc_c"
  664. rm -f _shar_wnt_.tmp
  665. fi
  666. # ============= dmake/unix/coherent/make.sh ==============
  667. if test -f 'dmake/unix/coherent/make.sh' -a X"$1" != X"-c"; then
  668.     echo 'x - skipping dmake/unix/coherent/make.sh (File already exists)'
  669.     rm -f _shar_wnt_.tmp
  670. else
  671. > _shar_wnt_.tmp
  672. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/make.sh' &&
  673. mkdir objects
  674. cc -c -I. -Iunix -Iunix/coherent -O infer.c
  675. mv infer.o objects
  676. cc -c -I. -Iunix -Iunix/coherent -O make.c
  677. mv make.o objects
  678. cc -c -I. -Iunix -Iunix/coherent -O stat.c
  679. mv stat.o objects
  680. cc -c -I. -Iunix -Iunix/coherent -O expand.c
  681. mv expand.o objects
  682. cc -c -I. -Iunix -Iunix/coherent -O dmstring.c
  683. mv dmstring.o objects
  684. cc -c -I. -Iunix -Iunix/coherent -O hash.c
  685. mv hash.o objects
  686. cc -c -I. -Iunix -Iunix/coherent -O dag.c
  687. mv dag.o objects
  688. cc -c -I. -Iunix -Iunix/coherent -O dmake.c
  689. mv dmake.o objects
  690. cc -c -I. -Iunix -Iunix/coherent -O path.c
  691. mv path.o objects
  692. cc -c -I. -Iunix -Iunix/coherent -O imacs.c
  693. mv imacs.o objects
  694. cc -c -I. -Iunix -Iunix/coherent -O sysintf.c
  695. mv sysintf.o objects
  696. cc -c -I. -Iunix -Iunix/coherent -O parse.c
  697. mv parse.o objects
  698. cc -c -I. -Iunix -Iunix/coherent -O getinp.c
  699. mv getinp.o objects
  700. cc -c -I. -Iunix -Iunix/coherent -O quit.c
  701. mv quit.o objects
  702. cc -c -I. -Iunix -Iunix/coherent -O state.c
  703. mv state.o objects
  704. cc -c -I. -Iunix -Iunix/coherent -O basename.c
  705. mv basename.o objects
  706. cc -c -I. -Iunix -Iunix/coherent -O dmdump.c
  707. mv dmdump.o objects
  708. cc -c -I. -Iunix -Iunix/coherent -O macparse.c
  709. mv macparse.o objects
  710. cc -c -I. -Iunix -Iunix/coherent -O rulparse.c
  711. mv rulparse.o objects
  712. cc -c -I. -Iunix -Iunix/coherent -O percent.c
  713. mv percent.o objects
  714. cc -c -I. -Iunix -Iunix/coherent -O function.c
  715. mv function.o objects
  716. cc -c -I. -Iunix -Iunix/coherent -O unix/arlib.c
  717. mv arlib.o objects
  718. cc -c -I. -Iunix -Iunix/coherent -O unix/dirbrk.c
  719. mv dirbrk.o objects
  720. cc -c -I. -Iunix -Iunix/coherent -O unix/rmprq.c
  721. mv rmprq.o objects
  722. cc -c -I. -Iunix -Iunix/coherent -O unix/ruletab.c
  723. mv ruletab.o objects
  724. cc -c -I. -Iunix -Iunix/coherent -O unix/runargv.c
  725. mv runargv.o objects
  726. cc -c -I. -Iunix -Iunix/coherent -O unix/coherent/vfprintf.c
  727. mv vfprintf.o objects
  728. cc -c -I. -Iunix -Iunix/coherent -O unix/coherent/getcwd.c
  729. mv getcwd.o objects
  730. cc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/state.o objects/basename.o objects/dmdump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/vfprintf.o objects/getcwd.o 
  731. cp unix/coherent/startup.mk startup.mk
  732. SHAR_EOF
  733. chmod 0640 dmake/unix/coherent/make.sh ||
  734. echo 'restore of dmake/unix/coherent/make.sh failed'
  735. Wc_c="`wc -c < 'dmake/unix/coherent/make.sh'`"
  736. test 2405 -eq "$Wc_c" ||
  737.     echo 'dmake/unix/coherent/make.sh: original size 2405, current size' "$Wc_c"
  738. rm -f _shar_wnt_.tmp
  739. fi
  740. # ============= dmake/unix/coherent/public.h ==============
  741. if test -f 'dmake/unix/coherent/public.h' -a X"$1" != X"-c"; then
  742.     echo 'x - skipping dmake/unix/coherent/public.h (File already exists)'
  743.     rm -f _shar_wnt_.tmp
  744. else
  745. > _shar_wnt_.tmp
  746. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/public.h' &&
  747. /* RCS      -- $Header$
  748. -- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
  749. --
  750. -- SYNOPSIS -- Local functions exported to be visible by others.
  751. --
  752. -- DESCRIPTION
  753. --      This file is generated by 'genpub'.  Function declarations
  754. --      that appear in this file are extracted by 'genpub' from
  755. --      source files.  Any function in the source file whose definition
  756. --      appears like:
  757. --
  758. --          PUBLIC return_type
  759. --          function( arg_list );
  760. --          type_expr1 arg1;
  761. --          ...
  762. --
  763. --      has its definition extracted and a line of the form:
  764. --
  765. --          return_type function ANSI((type_expr1,type_expr2,...));
  766. --
  767. --      entered into the output file.
  768. --
  769. -- AUTHOR
  770. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  771. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  772. --
  773. -- COPYRIGHT
  774. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  775. -- 
  776. --      This program is free software; you can redistribute it and/or
  777. --      modify it under the terms of the GNU General Public License
  778. --      (version 1), as published by the Free Software Foundation, and
  779. --      found in the file 'LICENSE' included with this distribution.
  780. -- 
  781. --      This program is distributed in the hope that it will be useful,
  782. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  783. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  784. --      GNU General Public License for more details.
  785. -- 
  786. --      You should have received a copy of the GNU General Public License
  787. --      along with this program;  if not, write to the Free Software
  788. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  789. --
  790. -- LOG
  791. --     $Log$
  792. */
  793. X
  794. #ifndef _DMAKE_PUBLIC_h
  795. #define _DMAKE_PUBLIC_h
  796. X
  797. void Infer_recipe ANSI((CELLPTR, CELLPTR));
  798. int Make_targets ANSI(());
  799. int Exec_commands ANSI((CELLPTR));
  800. void Print_cmnd ANSI((char *, int, int));
  801. void Pop_dir ANSI((int));
  802. void Append_line ANSI((char *, int, FILE *, char *, int, int));
  803. void Stat_target ANSI((CELLPTR, int));
  804. char * Expand ANSI((char *));
  805. char * Apply_edit ANSI((char *, char *, char *, int, int));
  806. void Map_esc ANSI((char *));
  807. char* Apply_modifiers ANSI((int, char *));
  808. char* Tokenize ANSI((char *, char *));
  809. char * _strjoin ANSI((char *, char *, int, int));
  810. char * _stradd ANSI((char *, char *, int));
  811. char * _strapp ANSI((char *, char *));
  812. char * _strdup ANSI((char *));
  813. char * _strdup2 ANSI((char *));
  814. char * _strpbrk ANSI((char *, char *));
  815. char * _strspn ANSI((char *, char *));
  816. char * _strstr ANSI((char *, char *));
  817. char * _substr ANSI((char *, char *));
  818. uint16 Hash ANSI((char *, uint32 *));
  819. HASHPTR Get_name ANSI((char *, HASHPTR *, int));
  820. HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
  821. HASHPTR Def_macro ANSI((char *, char *, int));
  822. CELLPTR Def_cell ANSI((char *));
  823. LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
  824. void Clear_prerequisites ANSI((CELLPTR));
  825. int Test_circle ANSI((CELLPTR, int));
  826. STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
  827. t_attr Rcp_attribute ANSI((char *));
  828. int main ANSI((int, char **));
  829. FILE * Openfile ANSI((char *, int, int));
  830. FILE * Closefile ANSI(());
  831. FILE * Search_file ANSI((char *, char **));
  832. char * Filename ANSI(());
  833. int Nestlevel ANSI(());
  834. void No_ram ANSI(());
  835. int Usage ANSI((int));
  836. int Version ANSI(());
  837. char * Get_suffix ANSI((char *));
  838. char * Build_path ANSI((char *, char *));
  839. void Make_rules ANSI(());
  840. void Create_macro_vars ANSI(());
  841. time_t Do_stat ANSI((char *, char *, char **));
  842. int Do_touch ANSI((char *, char *, char **));
  843. void Void_lib_cache ANSI((char *, char *));
  844. time_t Do_time ANSI(());
  845. int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
  846. char ** Pack_argv ANSI((int, int, char *));
  847. char * Read_env_string ANSI((char *));
  848. int Write_env_string ANSI((char *, char *));
  849. void ReadEnvironment ANSI(());
  850. void Catch_signals ANSI((void (*)()));
  851. void Clear_signals ANSI(());
  852. void Prolog ANSI((int, char* []));
  853. void Epilog ANSI((int));
  854. char * Get_current_dir ANSI(());
  855. int Set_dir ANSI((char*));
  856. char Get_switch_char ANSI(());
  857. FILE* Get_temp ANSI((char **, char *, int));
  858. FILE * Start_temp ANSI((char *, CELLPTR, char **));
  859. void Open_temp_error ANSI((char *, char *));
  860. void Link_temp ANSI((CELLPTR, FILE *, char *));
  861. void Close_temp ANSI((CELLPTR, FILE *));
  862. void Unlink_temp_files ANSI((CELLPTR));
  863. void Handle_result ANSI((int, int, int, CELLPTR));
  864. void Update_time_stamp ANSI((CELLPTR));
  865. int Remove_file ANSI((char *));
  866. void Parse ANSI((FILE *));
  867. int Get_line ANSI((char *, FILE *));
  868. char * Do_comment ANSI((char *, char **, int));
  869. char * Get_token ANSI((TKSTRPTR, char *, int));
  870. void Quit ANSI(());
  871. void Read_state ANSI(());
  872. void Write_state ANSI(());
  873. int Check_state ANSI((CELLPTR, STRINGPTR *, int));
  874. char* basename ANSI((char *));
  875. void Dump ANSI(());
  876. void Dump_recipe ANSI((STRINGPTR));
  877. int Parse_macro ANSI((char *, int));
  878. int Macro_op ANSI((char *));
  879. int Parse_rule_def ANSI((int *));
  880. int Rule_op ANSI((char *));
  881. void Add_recipe_to_list ANSI((char *, int, int));
  882. void Bind_rules_to_targets ANSI((int));
  883. int Set_group_attributes ANSI((char *));
  884. DFALINKPTR Match_dfa ANSI((char *));
  885. void Check_circle_dfa ANSI(());
  886. void Add_nfa ANSI((char *));
  887. char * Exec_function ANSI((char *));
  888. time_t seek_arch ANSI((char *, char *));
  889. int If_root_path ANSI((char *));
  890. void Remove_prq ANSI((CELLPTR));
  891. int runargv ANSI((CELLPTR, int, int, int, int, char *));
  892. int Wait_for_child ANSI((int, int));
  893. void Clean_up_processes ANSI(());
  894. X
  895. #endif
  896. SHAR_EOF
  897. chmod 0640 dmake/unix/coherent/public.h ||
  898. echo 'restore of dmake/unix/coherent/public.h failed'
  899. Wc_c="`wc -c < 'dmake/unix/coherent/public.h'`"
  900. test 5448 -eq "$Wc_c" ||
  901.     echo 'dmake/unix/coherent/public.h: original size 5448, current size' "$Wc_c"
  902. rm -f _shar_wnt_.tmp
  903. fi
  904. # ============= dmake/unix/coherent/startup.mk ==============
  905. if test -f 'dmake/unix/coherent/startup.mk' -a X"$1" != X"-c"; then
  906.     echo 'x - skipping dmake/unix/coherent/startup.mk (File already exists)'
  907.     rm -f _shar_wnt_.tmp
  908. else
  909. > _shar_wnt_.tmp
  910. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/startup.mk' &&
  911. # Generic UNIX DMAKE startup file.  Customize to suit your needs.
  912. # Should work for both SYSV, and BSD 4.3
  913. # See the documentation for a description of internally defined macros.
  914. #
  915. # Disable warnings for macros redefined here that were given
  916. # on the command line.
  917. __.SILENT := $(.SILENT)
  918. .SILENT   := yes
  919. X
  920. # Configuration parameters for DMAKE startup.mk file
  921. # Set these to NON-NULL if you wish to turn the parameter on.
  922. _HAVE_RCS    := yes        # yes => RCS  is installed.
  923. _HAVE_SCCS    := yes        # yes => SCCS is installed.
  924. X
  925. # Applicable suffix definitions
  926. A := .a        # Libraries
  927. E :=        # Executables
  928. F := .f        # Fortran
  929. O := .o        # Objects
  930. P := .p        # Pascal
  931. S := .s        # Assembler sources
  932. V := ,v        # RCS suffix
  933. X
  934. # Recipe execution configurations
  935. SHELL        := /bin/sh
  936. SHELLFLAGS    := -ce
  937. GROUPSHELL    := $(SHELL)
  938. GROUPFLAGS    := 
  939. SHELLMETAS    := |();&<>?*][$$:\\#`'"
  940. GROUPSUFFIX    :=
  941. DIVFILE         = $(TMPFILE)
  942. X
  943. # Standard C-language command names and flags
  944. X   CPP       := /lib/cpp        # C-preprocessor
  945. X   CC      := cc        # C-compiler and flags
  946. X   CFLAGS  +=
  947. X
  948. X   AS      := as        # Assembler and flags
  949. X   ASFLAGS += 
  950. X
  951. X   LD       = $(CC)        # Loader and flags
  952. X   LDFLAGS +=
  953. X   LDLIBS   =
  954. X
  955. # Definition of $(MAKE) macro for recursive makes.
  956. X   MAKE = $(MAKECMD) $(MFLAGS)
  957. X
  958. # Definition of Print command for this system.
  959. X   PRINT = lpr
  960. X
  961. # Language and Parser generation Tools and their flags
  962. X   YACC      := yacc        # standard yacc
  963. X   YFLAGS +=
  964. X   YTAB      := y.tab        # yacc output files name stem.
  965. X
  966. X   LEX      := lex        # standard lex
  967. X   LFLAGS +=
  968. X   LEXYY  := lex.yy        # lex output file
  969. X
  970. # Other Compilers, Tools and their flags
  971. X   PC    := pc            # pascal compiler
  972. X   RC    := f77            # ratfor compiler
  973. X   FC    := f77            # fortran compiler
  974. X
  975. X   CO       := co        # check out for RCS
  976. X   COFLAGS += -q
  977. X
  978. X   AR     := ar            # archiver
  979. X   ARFLAGS+= ruv
  980. X
  981. X   RM       := /bin/rm        # remove a file command
  982. X   RMFLAGS +=
  983. X
  984. # Implicit generation rules for making inferences.
  985. # We don't provide .yr or .ye rules here.  They're obsolete.
  986. # Rules for making *$O
  987. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  988. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  989. X   %$O : %$S ; $(AS) $(ASFLAGS) $<
  990. X   %$O : %.cl ; class -c $<
  991. X   %$O : %.e %.r %.F %$F
  992. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  993. X
  994. # Executables
  995. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  996. X
  997. # lex and yacc rules
  998. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  999. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  1000. X
  1001. # This rule tells how to make *.out from it's immediate list of prerequisites
  1002. # UNIX only.
  1003. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  1004. X
  1005. # RCS support
  1006. .IF $(_HAVE_RCS)
  1007. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  1008. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  1009. .END
  1010. X
  1011. # SCCS support
  1012. .IF $(_HAVE_SCCS)
  1013. X   % : s.% ; get $<
  1014. X   .NOINFER : s.%
  1015. .END
  1016. X
  1017. # Recipe to make archive files.
  1018. %$A :
  1019. [
  1020. X   $(AR) $(ARFLAGS) $@ $?
  1021. X   $(RM) $(RMFLAGS) $?
  1022. X   ranlib $@
  1023. ]
  1024. X
  1025. # DMAKE uses this recipe to remove intermediate targets
  1026. .REMOVE :; $(RM) -f $<
  1027. X
  1028. # AUGMAKE extensions for SYSV compatibility
  1029. @B = $(@:b)
  1030. @D = $(@:d)
  1031. @F = $(@:f)
  1032. "*B" = $(*:b)
  1033. "*D" = $(*:d)
  1034. "*F" = $(*:f)
  1035. <B = $(<:b)
  1036. <D = $(<:d)
  1037. <F = $(<:f)
  1038. ?B = $(?:b)
  1039. ?F = $(?:f)
  1040. ?D = $(?:d)
  1041. X
  1042. # Turn warnings back to previous setting.
  1043. .SILENT := $(__.SILENT)
  1044. X
  1045. # Local startup file if any
  1046. .INCLUDE .IGNORE: "_startup.mk"
  1047. SHAR_EOF
  1048. chmod 0640 dmake/unix/coherent/startup.mk ||
  1049. echo 'restore of dmake/unix/coherent/startup.mk failed'
  1050. Wc_c="`wc -c < 'dmake/unix/coherent/startup.mk'`"
  1051. test 3227 -eq "$Wc_c" ||
  1052.     echo 'dmake/unix/coherent/startup.mk: original size 3227, current size' "$Wc_c"
  1053. rm -f _shar_wnt_.tmp
  1054. fi
  1055. # ============= dmake/unix/coherent/stdarg.h ==============
  1056. if test -f 'dmake/unix/coherent/stdarg.h' -a X"$1" != X"-c"; then
  1057.     echo 'x - skipping dmake/unix/coherent/stdarg.h (File already exists)'
  1058.     rm -f _shar_wnt_.tmp
  1059. else
  1060. > _shar_wnt_.tmp
  1061. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/stdarg.h' &&
  1062. /*
  1063. X * stdarg.h
  1064. X *
  1065. X * defines ANSI style macros for accessing arguments of a function which takes
  1066. X * a variable number of arguments
  1067. X *
  1068. X */
  1069. X
  1070. #if !defined(__STDARG_H__)
  1071. #define __STDARG_H__
  1072. X
  1073. #if !defined(_VA_LIST_) && !defined(_VA_LIST)
  1074. #define _VA_LIST_
  1075. #define _VA_LIST
  1076. typedef char *va_list;
  1077. #endif
  1078. X
  1079. #define va_dcl int va_alist
  1080. #define va_start(ap,v)  ap = (va_list)&va_alist
  1081. #define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
  1082. #define va_end(ap)      ap = NULL
  1083. #endif
  1084. SHAR_EOF
  1085. chmod 0640 dmake/unix/coherent/stdarg.h ||
  1086. echo 'restore of dmake/unix/coherent/stdarg.h failed'
  1087. Wc_c="`wc -c < 'dmake/unix/coherent/stdarg.h'`"
  1088. test 469 -eq "$Wc_c" ||
  1089.     echo 'dmake/unix/coherent/stdarg.h: original size 469, current size' "$Wc_c"
  1090. rm -f _shar_wnt_.tmp
  1091. fi
  1092. # ============= dmake/unix/coherent/stdlib.h ==============
  1093. if test -f 'dmake/unix/coherent/stdlib.h' -a X"$1" != X"-c"; then
  1094.     echo 'x - skipping dmake/unix/coherent/stdlib.h (File already exists)'
  1095.     rm -f _shar_wnt_.tmp
  1096. else
  1097. > _shar_wnt_.tmp
  1098. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/stdlib.h' &&
  1099. #ifndef _STDLIB_INCLUDED_
  1100. #define _STDLIB_INCLUDED_
  1101. X
  1102. extern /*GOTO*/ _exit();
  1103. extern /*GOTO*/ exit();
  1104. extern /*GOTO*/ abort();
  1105. extern int system();
  1106. extern char *getenv();
  1107. extern char *calloc();
  1108. extern char *malloc();
  1109. extern char *realloc();
  1110. extern free();
  1111. extern int errno;
  1112. X
  1113. #ifndef EIO
  1114. #    include <errno.h>
  1115. #endif
  1116. X
  1117. #endif /* _STDLIB_INCLUDED_ */
  1118. SHAR_EOF
  1119. chmod 0640 dmake/unix/coherent/stdlib.h ||
  1120. echo 'restore of dmake/unix/coherent/stdlib.h failed'
  1121. Wc_c="`wc -c < 'dmake/unix/coherent/stdlib.h'`"
  1122. test 346 -eq "$Wc_c" ||
  1123.     echo 'dmake/unix/coherent/stdlib.h: original size 346, current size' "$Wc_c"
  1124. rm -f _shar_wnt_.tmp
  1125. fi
  1126. # ============= dmake/unix/coherent/time.h ==============
  1127. if test -f 'dmake/unix/coherent/time.h' -a X"$1" != X"-c"; then
  1128.     echo 'x - skipping dmake/unix/coherent/time.h (File already exists)'
  1129.     rm -f _shar_wnt_.tmp
  1130. else
  1131. > _shar_wnt_.tmp
  1132. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/time.h' &&
  1133. /*
  1134. ** Berkeley get this wrong!
  1135. */
  1136. #ifndef    TIME_h
  1137. #define    TIME_h
  1138. X
  1139. typedef    long    time_t;    /* this is the thing we use */
  1140. X
  1141. #endif    TIME_h
  1142. X
  1143. SHAR_EOF
  1144. chmod 0640 dmake/unix/coherent/time.h ||
  1145. echo 'restore of dmake/unix/coherent/time.h failed'
  1146. Wc_c="`wc -c < 'dmake/unix/coherent/time.h'`"
  1147. test 133 -eq "$Wc_c" ||
  1148.     echo 'dmake/unix/coherent/time.h: original size 133, current size' "$Wc_c"
  1149. rm -f _shar_wnt_.tmp
  1150. fi
  1151. # ============= dmake/unix/coherent/vfprintf.c ==============
  1152. if test -f 'dmake/unix/coherent/vfprintf.c' -a X"$1" != X"-c"; then
  1153.     echo 'x - skipping dmake/unix/coherent/vfprintf.c (File already exists)'
  1154.     rm -f _shar_wnt_.tmp
  1155. else
  1156. > _shar_wnt_.tmp
  1157. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/coherent/vfprintf.c' &&
  1158. /* Portable vfprintf and vprintf by Robert A. Larson <blarson@skat.usc.edu> */
  1159. X
  1160. /* Copyright 1989 Robert A. Larson.
  1161. X * Distribution in any form is allowed as long as the author
  1162. X * retains credit, changes are noted by their author and the
  1163. X * copyright message remains intact.  This program comes as-is
  1164. X * with no warentee of fitness for any purpouse.
  1165. X *
  1166. X * Thanks to Doug Gwen, Chris Torek, and others who helped clarify
  1167. X * the ansi printf specs.
  1168. X *
  1169. X * Please send any bug fixes and improvments to blarson@skat.usc.edu .
  1170. X * The use of goto is NOT a bug.
  1171. X */
  1172. X
  1173. /* Feb    9, 1989        blarson        First usenet release */
  1174. X
  1175. /* This code implements the vfprintf function, without relying on
  1176. X * the existance of _doprint or other system specific code.
  1177. X *
  1178. X * Define NOVOID if void * is not a supported type.
  1179. X *
  1180. X * Two compile options are available for efficency:
  1181. X *    INTSPRINTF    should be defined if sprintf is int and returns
  1182. X *            the number of chacters formated.
  1183. X *    LONGINT        should be defined if sizeof(long) == sizeof(int)
  1184. X *
  1185. X *    They only make the code smaller and faster, they need not be
  1186. X *    defined.
  1187. X *
  1188. X * UNSIGNEDSPECIAL should be defined if unsigned is treated differently
  1189. X * than int in argument passing.  If this is definded, and LONGINT is not,
  1190. X * the compiler must support the type unsingned long.
  1191. X *
  1192. X * Most quirks and bugs of the available fprintf fuction are duplicated,
  1193. X * however * in the width and precision fields will work correctly
  1194. X * even if fprintf does not support this.  The %n format and the return
  1195. X * count will only work if fprintf returns the number of characters
  1196. X * formatted.
  1197. X *
  1198. X * Bad format strings, or those with very long width and precision
  1199. X * fields (including expanded * fields) will cause undesired results.
  1200. X */
  1201. X
  1202. #ifdef OSK        /* os9/68k can take advantage of both */
  1203. #define INTSPRINTF
  1204. #define LONGINT
  1205. #endif
  1206. #define NOVOID 1
  1207. X
  1208. /* This must be a typedef not a #define! */
  1209. #ifdef NOVOID
  1210. typedef char *pointer;
  1211. #else
  1212. typedef void *pointer;
  1213. #endif
  1214. X
  1215. #include <stdio.h>
  1216. X
  1217. #ifdef    INTSPRINTF
  1218. #define Sprintf(string,format,arg)    (sprintf((string),(format),(arg)))
  1219. #else
  1220. #define Sprintf(string,format,arg)    (\
  1221. X    sprintf((string),(format),(arg)),\
  1222. X    strlen(string)\
  1223. )
  1224. #endif
  1225. X
  1226. #include <stdarg.h>
  1227. X
  1228. typedef int *intp;
  1229. X
  1230. int vfprintf(dest, format, args)
  1231. FILE *dest;
  1232. register char *format;
  1233. va_list args;
  1234. {
  1235. X    register char c;
  1236. X    register char *tp;
  1237. X    register int count = 0;
  1238. X    char tempfmt[64];
  1239. #ifndef LONGINT
  1240. X    int longflag;
  1241. #endif
  1242. X
  1243. X    tempfmt[0] = '%';
  1244. X    while(c = *format++) {
  1245. X    if(c=='%') {
  1246. X        tp = &tempfmt[1];
  1247. #ifndef LONGINT
  1248. X        longflag = 0;
  1249. #endif
  1250. continue_format:
  1251. X        switch(c = *format++) {
  1252. X        case 's':
  1253. X            *tp++ = c;
  1254. X            *tp = '\0';
  1255. X            count += fprintf(dest, tempfmt, va_arg(args, char *));
  1256. X            break;
  1257. X        case 'u':
  1258. X        case 'x':
  1259. X        case 'o':
  1260. SHAR_EOF
  1261. true || echo 'restore of dmake/unix/coherent/vfprintf.c failed'
  1262. fi
  1263. echo 'End of part 36, continue with part 37'
  1264. echo 37 > _shar_seq_.tmp
  1265. exit 0
  1266. exit 0 # Just in case...
  1267.