Print this page
make: unifdef for SUNOS4_AND_AFTER (defined)
@@ -92,15 +92,11 @@
wchar_t tok[512];
wchar_t *p;
wchar_t *our_template;
int len;
Boolean cd;
-#ifdef SUNOS4_AND_AFTER
String_rec string;
-#else
- String string;
-#endif
Name name;
Name target;
struct Line *line;
struct Recursive *r;
Property recurse;
@@ -108,15 +104,11 @@
wchar_t tmpbuf[STRING_BUFFER_LENGTH];
#ifdef LTEST
printf("In nse_check_cd, nse = %d, nse_did_recursion = %d\n", nse, nse_did_recursion);
#endif
-#ifdef SUNOS4_AND_AFTER
if (!nse_did_recursion || !nse) {
-#else
- if (is_false(nse_did_recursion) || is_false(flag.nse)) {
-#endif
#ifdef LTEST
printf ("returning, nse = %d, nse_did_recursion = %d\n", nse, nse_did_recursion);
#endif
return;
}
@@ -130,27 +122,18 @@
cd = false;
while (nse_gettoken(&our_template, tok)) {
#ifdef LTEST
printf("in gettoken loop\n");
#endif
-#ifdef SUNOS4_AND_AFTER
if (IS_WEQUAL(tok, (wchar_t *) "cd")) {
-#else
- if (is_equal(tok, "cd")) {
-#endif
cd = true;
} else if (cd && tok[0] == '$') {
nse_backquote_seen = NULL;
nse_shell_var_used = NULL;
nse_watch_vars = true;
-#ifdef SUNOS4_AND_AFTER
INIT_STRING_FROM_STACK(string, strbuf);
name = GETNAME(tok, FIND_LENGTH);
-#else
- init_string_from_stack(string, strbuf);
- name = getname(tok, FIND_LENGTH);
-#endif
expand_value(name, &string, false);
nse_watch_vars = false;
#ifdef LTEST
printf("cd = %d, tok = $\n", cd);
@@ -188,19 +171,13 @@
if (primary_makefile != NULL) {
target = prop->body.line.target;
recurse = get_prop(target->prop, recursive_prop);
while (recurse != NULL) {
r = &recurse->body.recursive;
-#ifdef SUNOS4_AND_AFTER
if (IS_WEQUAL(r->directory->string, (wchar_t *) ".") &&
!IS_WEQUAL(r->makefiles->name->string,
primary_makefile->string)) {
-#else
- if (is_equal(r->directory->string, ".") &&
- !is_equal(r->makefiles->name->string,
- primary_makefile->string)) {
-#endif
nse_warning();
fprintf(stderr, "\tRecursion to makefile `%s' in the same directory\n\tCommand line: %s\n",
r->makefiles->name->string_mb,
line->command_template->command_line->string_mb);
}
@@ -215,15 +192,11 @@
* error, otherwise, just a warning.
*/
static void
nse_warning(void)
{
-#ifdef SUNOS4_AND_AFTER
if (report_dependencies_level > 0) {
-#else
- if (is_true(flag.report_dependencies)) {
-#endif
our_exit_status = 1;
}
if (primary_makefile != NULL) {
fprintf(stderr, "make: NSE warning from makefile %s/%s:\n",
get_current_path(), primary_makefile->string_mb);
@@ -273,22 +246,14 @@
nse_check_sccs(wchar_t *targ, wchar_t *dep)
{
wchar_t *slash;
wchar_t *p;
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
-#ifdef SUNOS4_AND_AFTER
slash = wsrchr(dep, (int) slash_char);
-#else
- slash = rindex(dep, '/');
-#endif
if (slash == NULL) {
return;
}
if (slash[1] != 's' || slash[2] != '.') {
return;
@@ -301,16 +266,12 @@
if (*p == '/') {
break;
}
}
p++;
-#ifdef SUNOS4_AND_AFTER
MBSTOWCS(wcs_buffer, "SCCS/");
if (IS_WEQUALN(p, wcs_buffer, wslen(wcs_buffer))) {
-#else
- if (is_equaln(p, "SCCS/", 5)) {
-#endif
nse_warning();
WCSTOMBS(mbs_buffer, targ);
WCSTOMBS(mbs_buffer2, dep);
fprintf(stderr, "\tFile `%s' depends upon SCCS file `%s'\n",
mbs_buffer, mbs_buffer2);
@@ -324,15 +285,11 @@
* but make does not so the files always appear to be out of date.
*/
void
nse_check_file_backquotes(wchar_t *file)
{
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
if (nse_backquotes(file)) {
nse_warning();
WCSTOMBS(mbs_buffer, file);
@@ -347,19 +304,13 @@
Boolean
nse_backquotes(wchar_t *str)
{
wchar_t *bq;
-#ifdef SUNOS4_AND_AFTER
bq = wschr(str, (int) backquote_char);
if (bq) {
bq = wschr(&bq[1], (int) backquote_char);
-#else
- bq = index(str, '`');
- if (bq) {
- bq = index(&bq[1], '`');
-#endif
if (bq) {
return true;
}
}
return false;
@@ -371,15 +322,11 @@
* this and will not get the same set of dependencies.
*/
void
nse_dep_cmdmacro(wchar_t *macro)
{
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
nse_warning();
WCSTOMBS(mbs_buffer, macro);
fprintf(stderr, "\tVariable `%s' is defined on the command-line and\n\taffects dependencies\n",
@@ -393,15 +340,11 @@
* depending upon how it is invoked.
*/
void
nse_rule_cmdmacro(wchar_t *macro)
{
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
nse_warning();
WCSTOMBS(mbs_buffer, macro);
fprintf(stderr, "\tMake invoked recursively by cd'ing to a directory\n\tspecified by a variable (%s) defined on the command-line\n",
@@ -414,15 +357,11 @@
* can change without changing the Makefile.
*/
void
nse_wildcard(wchar_t *targ, wchar_t *dep)
{
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
nse_warning();
WCSTOMBS(mbs_buffer, targ);
WCSTOMBS(mbs_buffer2, dep);
@@ -446,17 +385,12 @@
if (fp == NULL) {
return;
}
bpatch = &sufx_hdr;
while (fscanf(fp, "%s %*s", suffix) == 1) {
-#ifdef SUNOS4_AND_AFTER
sufx = ALLOC(Nse_suffix);
sufx->suffix = wscpy(ALLOC_WC(wslen(suffix) + 1), suffix);
-#else
- sufx = alloc(Nse_suffix);
- sufx->suffix = strcpy(malloc(strlen(suffix) + 1), suffix);
-#endif
sufx->next = NULL;
*bpatch = sufx;
bpatch = &sufx->next;
}
fclose(fp);
@@ -476,39 +410,23 @@
{
Nse_suffix sufx;
wchar_t *suffix;
wchar_t *depsufx;
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
-#ifdef SUNOS4_AND_AFTER
if (target->stat.is_derived_src) {
-#else
- if (is_true(target->stat.is_derived_src)) {
-#endif
return;
}
if (command_template != NULL) {
return;
}
-#ifdef SUNOS4_AND_AFTER
suffix = wsrchr(target->string, (int) period_char );
-#else
- suffix = rindex(target->string, '.');
-#endif
if (suffix != NULL) {
for (sufx = sufx_hdr; sufx != NULL; sufx = sufx->next) {
-#ifdef SUNOS4_AND_AFTER
if (IS_WEQUAL(sufx->suffix, suffix)) {
-#else
- if (is_equal(sufx->suffix, suffix)) {
-#endif
nse_warning();
WCSTOMBS(mbs_buffer, dep);
fprintf(stderr, "\tProbable source file `%s' appears as a derived file\n\tas it depends upon file `%s', but there is\n\tno rule to build it\n",
target->string_mb, mbs_buffer);
break;
@@ -526,46 +444,26 @@
nse_check_no_deps_no_rule(Name target, Property line, Property command)
{
Nse_suffix sufx;
wchar_t *suffix;
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
-#ifdef SUNOS4_AND_AFTER
if (target->stat.is_derived_src) {
-#else
- if (is_true(target->stat.is_derived_src)) {
-#endif
return;
}
if (line != NULL && line->body.line.dependencies != NULL) {
return;
}
-#ifdef SUNOS4_AND_AFTER
if (command->body.line.sccs_command) {
-#else
- if (is_true(command->body.line.sccs_command)) {
-#endif
return;
}
-#ifdef SUNOS4_AND_AFTER
suffix = wsrchr(target->string, (int) period_char);
-#else
- suffix = rindex(target->string, '.');
-#endif
if (suffix != NULL) {
for (sufx = sufx_hdr; sufx != NULL; sufx = sufx->next) {
-#ifdef SUNOS4_AND_AFTER
if (IS_WEQUAL(sufx->suffix, suffix)) {
-#else
- if (is_equal(sufx->suffix, suffix)) {
-#endif
if (command->body.line.command_template == NULL) {
nse_warning();
fprintf(stderr, "\tProbable source file `%s' appears as a derived file because\n\tit is on the left-hand side, but it has no dependencies and\n\tno rule to build it\n",
target->string_mb);
}
@@ -579,15 +477,11 @@
* without using a makefile.
*/
void
nse_no_makefile(Name target)
{
-#ifdef SUNOS4_AND_AFTER
if (!nse) {
-#else
- if (is_false(flag.nse)) {
-#endif
return;
}
nse_warning();
fprintf(stderr, "Recursive make to derive %s did not use a makefile\n",
target->string_mb);