home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume19 / dmake / part34 < prev    next >
Encoding:
Text File  |  1991-05-13  |  40.6 KB  |  1,290 lines

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