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

View File

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