[FIX] Make codebase *slightly* NetBSD-friendly

I need to make it so that NetBSD targets get their own
correctness/build checks in CI. I also had to do some hacks with
Cytoplasm, will make a PR for those soon.
This commit is contained in:
LDA 2024-10-22 10:21:54 +02:00
commit b0cf0961a3
13 changed files with 35 additions and 25 deletions

View file

@ -531,7 +531,7 @@ main_build(int argc, char *argv[])
fprintf(makefile, "-DNAME=\"\\\"$(NAME)\\\"\" ");
fprintf(makefile, "-DCODE=\"\\\"$(CODE)\\\"\" ");
fprintf(makefile, "-DREPOSITORY=\"\\\"%s\\\"\" ", repo);
fprintf(makefile, "$(CFLAGS) $< -o $@\n");
fprintf(makefile, "$(CFLAGS) %s -o %s\n", src, obj);
}
free(ofl);
free(obj);
@ -560,8 +560,8 @@ main_build(int argc, char *argv[])
sym = string_rep_ext(sym, ".o", "");
str_array_free(s);
fprintf(makefile, "\ttools/out/b64 $< 'media_%s' '%s.c'\n", sym, obj);
fprintf(makefile, "\t$(CC) -c %s.c -o $@\n", obj);
fprintf(makefile, "\ttools/out/b64 %s 'media_%s' '%s.c'\n", src, sym, obj);
fprintf(makefile, "\t$(CC) -c %s.c -o %s\n", obj, obj);
free(sym);
}
free(obj);
@ -583,12 +583,12 @@ main_build(int argc, char *argv[])
fprintf(makefile, "%s: %s\n", obj, src);
{
fprintf(makefile, "\t@mkdir -p tools/out\n");
fprintf(makefile, "\t$(CC) -o $@");
fprintf(makefile, "\t$(CC) -o %s", obj);
if (with_static)
{
fprintf(makefile, " -static");
}
fprintf(makefile, " $<");
fprintf(makefile, " %s", src);
fprintf(makefile, " -I $(CYTO_INC)");
fprintf(makefile, " -L $(CYTO_LIB)");
if (with_static)
@ -632,7 +632,7 @@ main_build(int argc, char *argv[])
"\ttools/out/aya "
"-C etc/ayadoc/style.css "
"-p $(NAME) "
"-i $< -o $@\n"
"-i %s -o %s\n", src, obj
);
}