This commit is contained in:
2025-09-07 17:45:03 -04:00
parent d5629128f1
commit 984d5a54fe

View File

@@ -35,14 +35,16 @@ int create_project(manifest_t manifest)
"%s ( short description )\n\nThis cool project actions adverbly.\n", "%s ( short description )\n\nThis cool project actions adverbly.\n",
manifest.project); manifest.project);
main_source = manifest.flat ? "main.c" : "src/main.c"; if (manifest.build != BARE) {
cfprintf(main_source, "#include <stdio.h>\n" main_source = manifest.flat ? "main.c" : "src/main.c";
"\n" cfprintf(main_source, "#include <stdio.h>\n"
"int main()\n" "\n"
"{\n" "int main()\n"
"\tputs(\"Hello, World!\");\n" "{\n"
"\treturn 0;\n" "\tputs(\"Hello, World!\");\n"
"}\n"); "\treturn 0;\n"
"}\n");
}
char *upr_name = tostrupr(manifest.project); char *upr_name = tostrupr(manifest.project);
switch (manifest.build) { switch (manifest.build) {
case MAKE: case MAKE:
@@ -107,11 +109,19 @@ int create_project(manifest_t manifest)
"autoreconf --install --verbose --force\n"); "autoreconf --install --verbose --force\n");
break; break;
case BARE: case BARE:
cfprintf("main.c", ""); snprintf(buffer, BUFSIZ, "%s.c", manifest.project);
cfprintf( cfprintf(buffer, "");
"Makefile", main_source = str_dup(buffer);
".POSIX:\nCC ::= gcc\nCFLAGS ::= -std=c23 -Wall -Wextra -Wpedantic\n\nall: %s\n\nclean\n\t$(RM) %s", cfprintf("Makefile",
manifest.project, manifest.project); ".POSIX:\n"
"CC ::= gcc\n"
"CFLAGS ::= -std=c23 -Wall -Wextra -Wpedantic\n"
"\n"
"all: %s\n"
"\n"
"clean:\n"
"\t$(RM) %s",
manifest.project, manifest.project);
break; break;
case BCOUNT: case BCOUNT:
default: default: