summaryrefslogtreecommitdiff
path: root/maje.c
diff options
context:
space:
mode:
Diffstat (limited to 'maje.c')
-rw-r--r--maje.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/maje.c b/maje.c
index c67af52..a449d17 100644
--- a/maje.c
+++ b/maje.c
@@ -42,13 +42,12 @@ int main(int argc, char *argv[])
struct majefile *sources = find_source_files(srcdir);
char *mainname = find_main(sources);
- if (!mainname) {
- printf("libraries not yet supported\n");
- return 0;
+ char *target = NULL;
+ if (mainname) {
+ target = strdup(mainname);
+ target[strlen(target) - 2] = '\0';
+ target = basename(target);
}
- char *target = strdup(mainname);
- target[strlen(target) - 2] = '\0';
- target = basename(target);
FILE *makefile = fopen("Makefile", "w");
if (makefile == NULL) {