#include "config.h"
void read_files(void);
-void do_objs(FILE *fp, const char *msg, int ext);
+void do_objs(FILE *fp, const char *msg, int ext, int flags);
void do_files(FILE *fp, const char *msg, char ext);
void do_machdep(FILE *ofp);
void do_rules(FILE *f);
continue;
percent:
if (eq(line, "%OBJS\n")) {
- do_objs(ofp, "OBJS=", -1);
+ do_objs(ofp, "OBJS=", -1, 0);
+ } else if (eq(line, "%LIBOBJS\n")) {
+ do_objs(ofp, "LIBOBJS=", -1, LIBRARYDEP);
} else if (eq(line, "%CFILES\n")) {
do_files(ofp, "CFILES=", 'c');
- do_objs(ofp, "COBJS=", 'c');
+ do_objs(ofp, "COBJS=", 'c', 0);
} else if (eq(line, "%CXXFILES\n")) {
do_files(ofp, "CXXFILES=", 'p');
- do_objs(ofp, "CXXOBJS=", 'p');
+ do_objs(ofp, "CXXOBJS=", 'p', 0);
} else if (eq(line, "%SFILES\n")) {
do_files(ofp, "SFILES=", 's');
- do_objs(ofp, "SOBJS=", 's');
+ do_objs(ofp, "SOBJS=", 's', 0);
} else if (eq(line, "%MACHDEP\n")) {
do_machdep(ofp);
} else if (eq(line, "%RULES\n")) {
const char *devorprof;
int options;
int not_option;
+ int for_xnu_lib;
char pname[BUFSIZ];
char fname[1024];
char *rest = (char *) 0;
nreqs = 0;
devorprof = "";
needs = 0;
+ for_xnu_lib = 0;
if (eq(wd, "standard")) {
goto checkdev;
}
next_word(fp, wd);
goto save;
}
+ if (eq(wd, "xnu-library")) {
+ for_xnu_lib = 1;
+ goto nextopt;
+ }
nreqs++;
if (needs == 0 && nreqs == 1) {
needs = ns(wd);
goto getrest;
}
next_word(fp, wd);
+ if (wd && eq(wd, "xnu-library")) {
+ for_xnu_lib = 1;
+ next_word(fp, wd);
+ }
if (wd) {
devorprof = wd;
next_word(fp, wd);
if (pf && pf->f_type == INVISIBLE) {
pf->f_flags = 1; /* mark as duplicate */
}
+ if (for_xnu_lib) {
+ tp->f_flags |= LIBRARYDEP;
+ }
goto next;
}
}
void
-do_objs(FILE *fp, const char *msg, int ext)
+do_objs(FILE *fp, const char *msg, int ext, int flags)
{
struct file_list *tp;
int lpos, len;
continue;
}
+ /*
+ * Check flags (if any)
+ */
+ if (flags && ((tp->f_flags & flags) != flags)) {
+ continue;
+ }
+
/*
* Check for '.o' file in list
*/