home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / MAK358AS.ZIP / MAKE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-22  |  9.2 KB  |  304 lines

  1. /* Copyright (C) 1988, 1989 Free Software Foundation, Inc.
  2. This file is part of GNU Make.
  3.  
  4. GNU Make is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 1, or (at your option)
  7. any later version.
  8.  
  9. GNU Make is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with GNU Make; see the file COPYING.  If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /*
  19.  * MS-DOS port (c) 1990 by Thorsten Ohl <ohl@gnu.ai.mit.edu>
  20.  *
  21.  * To this port, the same copying conditions apply as to the
  22.  * original release.
  23.  *
  24.  * IMPORTANT:
  25.  * This file is not identical to the original GNU release!
  26.  * You should have received this code as patch to the official
  27.  * GNU release.
  28.  *
  29.  * MORE IMPORTANT:
  30.  * This port comes with ABSOLUTELY NO WARRANTY.
  31.  *
  32.  * $Header: e:/gnu/make/RCS/make.h'v 3.58.0.3 90/08/27 01:25:24 tho Exp $
  33.  */
  34.  
  35. #include <signal.h>
  36. #include <stdio.h>
  37.  
  38. #ifndef    sun
  39. #include <sys/types.h>
  40. #endif
  41.  
  42.  
  43. #ifndef MSDOS
  44. #include <sys/param.h>
  45. #endif /* not MSDOS */
  46. #ifndef MAXPATHLEN
  47. #define MAXPATHLEN 1024
  48. #endif    /* No MAXPATHLEN.  */
  49.  
  50. #include <sys/stat.h>
  51.  
  52. #ifdef    USG
  53. #include <string.h>
  54. #define    index(s, c)    strchr((s), (c))
  55. #define    rindex(s, c)    strrchr((s), (c))
  56.  
  57. #include <memory.h>
  58. #define bcmp(s1, s2, n)    memcmp ((s1), (s2), (n))
  59. #define bzero(s, n)    memset ((s), 0, (n))
  60. #define bcopy(s, d, n)    memcpy ((d), (s), (n))
  61.  
  62. #else    /* Not USG.  */
  63. #include <strings.h>
  64.  
  65. extern int bcmp ();
  66. extern void bzero (), bcopy ();
  67.  
  68. #endif    /* USG.  */
  69.  
  70. #ifdef    __GNUC__
  71. #define    alloca(n)    __builtin_alloca (n)
  72. #else    /* Not GCC.  */
  73. #ifdef    sparc
  74. #include <alloca.h>
  75. #else    /* Not sparc.  */
  76. #ifdef MSDOS
  77. #include <malloc.h>
  78. #else /* not MSDOS */
  79. extern char *alloca ();
  80. #endif /* not MSDOS  */
  81. #endif    /* sparc.  */
  82. #endif    /* GCC.  */
  83.  
  84. #ifndef    iAPX286
  85. #define streq(a, b) \
  86.   ((a) == (b) || \
  87.    (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
  88. #else
  89. /* Buggy compiler can't handle this.  */
  90. #define streq(a, b) (strcmp ((a), (b)) == 0)
  91. #endif
  92.  
  93. /* Add to VAR the hashing value of C, one character in a name.  */
  94. #define    HASH(var, c) \
  95.   ((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
  96.  
  97. #if defined(__GNUC__) || defined(ENUM_BITFIELDS)
  98. #define    ENUM_BITFIELD(bits)    :bits
  99. #else
  100. #define    ENUM_BITFIELD(bits)
  101. #endif
  102.  
  103. #ifdef MSDOS
  104. extern  void die (int status);
  105. #else /* not MSDOS */
  106. extern void die ();
  107. #endif /* not MSDOS */
  108.  
  109. /*     misc.c */
  110. #ifdef MSDOS
  111. extern  char *concat (char *s1, char *s2, char *s3);
  112. extern  char *end_of_token (char *s);
  113. extern  char *find_next_token (char **ptr, unsigned int *lengthptr);
  114. extern  char *lindex (char *s, char *limit, int c);
  115. extern  char *next_token (char *s);
  116. extern  char *savestring (char *str, unsigned int length);
  117. extern  char *sindex (char *big, unsigned int blen, char *small,
  118.               unsigned int slen);
  119. extern  char *xmalloc (unsigned int size);
  120. extern  char *xrealloc (char *ptr, unsigned int size);
  121. extern  int alpha_compare (char **s1, char **s2);
  122. extern  struct dep *copy_dep_chain (struct dep *d);
  123. extern  void collapse_continuations (char *line);
  124. extern  void collapse_line (char *line);
  125. extern  void error (char *s1, ...);
  126. extern  void fatal (char *s1, ...);
  127. extern  void perror_with_name (char *str, char *name);
  128. extern  void pfatal_with_name (char *name);
  129. extern  void print_spaces (unsigned int n);
  130. #else /* not MSDOS */
  131. extern void fatal (), error ();
  132. extern void pfatal_with_name (), perror_with_name ();
  133. extern char *savestring (), *concat ();
  134. extern char *xmalloc (), *xrealloc ();
  135. extern char *find_next_token (), *next_token (), *end_of_token ();
  136. extern void collapse_continuations (), collapse_line ();
  137. extern char *sindex (), *lindex ();
  138. extern int alpha_compare ();
  139. extern void print_spaces ();
  140. extern struct dep *copy_dep_chain ();
  141. extern char *find_percent ();
  142. #endif /* not MSDOS */
  143.  
  144. /* ar.c */
  145. #ifndef    NO_ARCHIVES
  146. #ifdef MSDOS
  147. extern  int ar_name (char *name);
  148. extern  int ar_touch (char *name);
  149. extern  long ar_member_date (char *name);
  150. #else /* not MSDOS */
  151. extern int ar_name ();
  152. extern int ar_touch ();
  153. extern time_t ar_member_date ();
  154. #endif /* not MSDOS */
  155. #endif
  156.  
  157. /* dir.c */
  158. #ifdef MSDOS
  159. extern  char *dir_name (char *dir);
  160. extern  int dir_file_exists_p (char *dirname, char *filename);
  161. extern  int file_exists_p (char *name);
  162. extern  int file_impossible_p (char *filename);
  163. extern  void file_impossible (char *filename);
  164. extern  void print_dir_data_base (void);
  165. #else /* not MSDOS */
  166. extern void dir_load ();
  167. extern int dir_file_exists_p (), file_exists_p (), file_impossible_p ();
  168. extern void file_impossible ();
  169. extern char *dir_name ();
  170. #endif /* not MSDOS */
  171.  
  172. /* default.c */
  173. #ifdef MSDOS
  174. extern  void install_default_implicit_rules (void);
  175. extern  void set_default_suffixes (void);
  176. #else /* not MSDOS */
  177. extern void set_default_suffixes (), install_default_implicit_rules ();
  178. #endif /* not MSDOS */
  179.  
  180. /* rule.c */
  181. #ifdef MSDOS
  182. extern  void convert_to_pattern (void);
  183. extern  void count_implicit_rule_limits (void);
  184. extern  void create_pattern_rule (char **targets, char **target_percents,
  185.                   int terminal, struct dep *deps,
  186.                   struct commands *commands, int override);
  187. extern  void print_rule_data_base (void);
  188. #else /* not MSDOS */
  189. extern void convert_to_pattern (), count_implicit_rule_limits ();
  190. extern void create_pattern_rule ();
  191. #endif /* not MSDOS */
  192.  
  193. /*    vpath.c */
  194. #ifdef MSDOS
  195. extern  int vpath_search (char **file);
  196. extern  void build_vpath_lists (void);
  197. extern  void construct_vpath_list (char *pattern, char *dirpath);
  198. extern  void print_vpath_data_base (void);
  199. #else /* not MSDOS */
  200. extern void build_vpath_lists (), construct_vpath_list ();
  201. extern int vpath_search ();
  202. #endif /* not MSDOS */
  203.   
  204. /*     read.c */
  205. #ifdef MSDOS
  206. extern  char *find_percent (char *pattern);
  207. extern  struct dep *read_all_makefiles (char **makefiles);
  208. extern  void uniquize_deps (struct dep *chain);
  209. extern  void construct_include_path (char **arg_dirs);
  210. #else /* not MSDOS */
  211. extern void construct_include_path ();
  212. #endif /* not MSDOS */
  213.  
  214. /*   remake.c */
  215. #ifdef MSDOS
  216. extern  int update_goal_chain (struct dep *goals, int makefiles);
  217. extern  void notice_finished_file (struct file *file);
  218. extern  time_t f_mtime (struct file *file, int search);
  219. extern  int remote_kill (int id, int sig);
  220. extern  int remote_status (int *exit_code_ptr, int *signal_ptr,
  221.                int *coredump_ptr, int block);
  222. extern  int start_remote_job (char **argv, int stdin_fd, int *is_remote,
  223.                   int *id_ptr, int *used_stdin);
  224. extern  int start_remote_job_p (void);
  225. extern  void block_remote_children (void);
  226. extern  void unblock_remote_children (void);
  227. #else /* not MSDOS */
  228. extern int update_goal_chain ();
  229. extern void notice_finished_file ();
  230. #endif /* not MSDOS */
  231.  
  232. /* glob.c */
  233. #ifdef MSDOS
  234. extern  char **glob_filename (char *pathname);
  235. extern  char **glob_vector (char *pat, char *dir);
  236. extern  int glob_match (char *pattern, char *text, int dot_special);
  237. extern  int glob_pattern_p (char *pattern);
  238. #else /* not MSDOS */
  239. extern int glob_pattern_p ();
  240. extern char **glob_filename ();
  241. #endif /* not MSDOS */
  242.  
  243. #ifdef MSDOS
  244. #include <stdlib.h>
  245. #else /* not MSDOS */
  246. #ifndef    USG
  247. extern int sigsetmask ();
  248. #endif
  249. extern int kill (), sigblock ();
  250. extern void free ();
  251. extern void abort (), exit ();
  252. extern int unlink (), stat ();
  253. extern void qsort ();
  254. extern int atoi ();
  255. extern int pipe (), close (), open (), lseek (), read ();
  256. extern char *ctime ();
  257. #endif /* not MSDOS */
  258.  
  259. #ifdef MSDOS
  260. extern  char **construct_command_argv (char *line, struct file *file);
  261. extern  void wait_for_children (unsigned int n, int err);
  262. extern  void wait_to_start_job (void);
  263. extern  void init_siglist (void);
  264. extern  void print_file_variables (struct file *file);
  265. extern  int try_implicit_rule (struct file *file, unsigned int depth);
  266. #endif /* MSDOS */
  267.  
  268. #ifndef MSDOS            /* <stdlib.h> */
  269. extern char **environ;
  270. #endif /* not MSDOS */
  271.  
  272. #ifdef    USG
  273. extern char *getcwd ();
  274. #ifdef MSDOS
  275. extern char *msdos_format_filename (char *name);
  276. #define    getwd(buf)    msdos_format_filename (getcwd (buf, MAXPATHLEN - 2))
  277. #else /* not MSDOS */
  278. #define    getwd(buf)    getcwd (buf, MAXPATHLEN - 2)
  279. #endif /* not MSDOS */
  280. #else    /* Not USG.  */
  281. extern char *getwd ();
  282. #endif    /* USG.  */
  283.  
  284.  
  285. extern char *reading_filename;
  286. extern unsigned int *reading_lineno_ptr;
  287.  
  288. extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
  289. extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
  290. extern int env_overrides, no_builtin_rules_flag, print_version_flag;
  291. extern int print_directory_flag;
  292.  
  293. extern unsigned int job_slots;
  294. extern double max_load_average;
  295.  
  296. extern char *program;
  297.  
  298. extern unsigned int makelevel;
  299.  
  300.  
  301. #define DEBUGPR(msg)                            \
  302.   if (debug_flag) { print_spaces (depth); printf (msg, file->name);    \
  303.             fflush (stdout);  } else
  304.