Deleted Added
full compact
mkmakefile.c (228153) mkmakefile.c (229403)
1/*
2 * Copyright (c) 1993, 19801990
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
33#endif
34static const char rcsid[] =
1/*
2 * Copyright (c) 1993, 19801990
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
33#endif
34static const char rcsid[] =
35 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 228153 2011-11-30 13:33:09Z fjoe $";
35 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 229403 2012-01-03 18:51:58Z ed $";
36#endif /* not lint */
37
38/*
39 * Build the makefile for the system, from
40 * the information in the files files and the
41 * additional files for the machine being compiled to.
42 */
43

--- 157 unchanged lines hidden (view full) ---

201 fprintf(ofp, "int hintmode = %d;\n", hintmode);
202 fprintf(ofp, "char static_hints[] = {\n");
203 STAILQ_FOREACH(hint, &hints, hint_next) {
204 ifp = fopen(hint->hint_name, "r");
205 if (ifp == NULL)
206 err(1, "%s", hint->hint_name);
207 while (fgets(line, BUFSIZ, ifp) != 0) {
208 /* zap trailing CR and/or LF */
36#endif /* not lint */
37
38/*
39 * Build the makefile for the system, from
40 * the information in the files files and the
41 * additional files for the machine being compiled to.
42 */
43

--- 157 unchanged lines hidden (view full) ---

201 fprintf(ofp, "int hintmode = %d;\n", hintmode);
202 fprintf(ofp, "char static_hints[] = {\n");
203 STAILQ_FOREACH(hint, &hints, hint_next) {
204 ifp = fopen(hint->hint_name, "r");
205 if (ifp == NULL)
206 err(1, "%s", hint->hint_name);
207 while (fgets(line, BUFSIZ, ifp) != 0) {
208 /* zap trailing CR and/or LF */
209 while ((s = rindex(line, '\n')) != NULL)
209 while ((s = strrchr(line, '\n')) != NULL)
210 *s = '\0';
210 *s = '\0';
211 while ((s = rindex(line, '\r')) != NULL)
211 while ((s = strrchr(line, '\r')) != NULL)
212 *s = '\0';
213 /* remove # comments */
212 *s = '\0';
213 /* remove # comments */
214 s = index(line, '#');
214 s = strchr(line, '#');
215 if (s)
216 *s = '\0';
217 /* remove any whitespace and " characters */
218 s = line;
219 while (*s) {
220 if (*s == ' ' || *s == '\t' || *s == '"') {
221 while (*s) {
222 s[0] = s[1];

--- 40 unchanged lines hidden (view full) ---

263 fprintf(ofp, "#include <sys/types.h>\n");
264 fprintf(ofp, "#include <sys/systm.h>\n");
265 fprintf(ofp, "\n");
266 fprintf(ofp, "int envmode = %d;\n", envmode);
267 fprintf(ofp, "char static_env[] = {\n");
268 if (ifp) {
269 while (fgets(line, BUFSIZ, ifp) != 0) {
270 /* zap trailing CR and/or LF */
215 if (s)
216 *s = '\0';
217 /* remove any whitespace and " characters */
218 s = line;
219 while (*s) {
220 if (*s == ' ' || *s == '\t' || *s == '"') {
221 while (*s) {
222 s[0] = s[1];

--- 40 unchanged lines hidden (view full) ---

263 fprintf(ofp, "#include <sys/types.h>\n");
264 fprintf(ofp, "#include <sys/systm.h>\n");
265 fprintf(ofp, "\n");
266 fprintf(ofp, "int envmode = %d;\n", envmode);
267 fprintf(ofp, "char static_env[] = {\n");
268 if (ifp) {
269 while (fgets(line, BUFSIZ, ifp) != 0) {
270 /* zap trailing CR and/or LF */
271 while ((s = rindex(line, '\n')) != NULL)
271 while ((s = strrchr(line, '\n')) != NULL)
272 *s = '\0';
272 *s = '\0';
273 while ((s = rindex(line, '\r')) != NULL)
273 while ((s = strrchr(line, '\r')) != NULL)
274 *s = '\0';
275 /* remove # comments */
274 *s = '\0';
275 /* remove # comments */
276 s = index(line, '#');
276 s = strchr(line, '#');
277 if (s)
278 *s = '\0';
279 /* remove any whitespace and " characters */
280 s = line;
281 while (*s) {
282 if (*s == ' ' || *s == '\t' || *s == '"') {
283 while (*s) {
284 s[0] = s[1];

--- 399 unchanged lines hidden (view full) ---

684 putc('\n', fp);
685}
686
687static char *
688tail(char *fn)
689{
690 char *cp;
691
277 if (s)
278 *s = '\0';
279 /* remove any whitespace and " characters */
280 s = line;
281 while (*s) {
282 if (*s == ' ' || *s == '\t' || *s == '"') {
283 while (*s) {
284 s[0] = s[1];

--- 399 unchanged lines hidden (view full) ---

684 putc('\n', fp);
685}
686
687static char *
688tail(char *fn)
689{
690 char *cp;
691
692 cp = rindex(fn, '/');
692 cp = strrchr(fn, '/');
693 if (cp == 0)
694 return (fn);
695 return (cp+1);
696}
697
698/*
699 * Create the makerules for each file
700 * which is part of the system.

--- 116 unchanged lines hidden ---
693 if (cp == 0)
694 return (fn);
695 return (cp+1);
696}
697
698/*
699 * Create the makerules for each file
700 * which is part of the system.

--- 116 unchanged lines hidden ---