summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--make.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/make.c b/make.c
index 1e21332..5d2c808 100644
--- a/make.c
+++ b/make.c
@@ -10,7 +10,7 @@ static void make_header(FILE *makefile, const char *target)
{
fprintf(makefile, ".POSIX:\n\n");
fprintf(makefile, "# This Makefile was generated by maje\n");
- fprintf(makefile, "# See https://gitlab.com/jkaivo/maje/ for more information\n");
+ fprintf(makefile, "# See https://src.kaivo.net/dev/maje/ for more information\n");
fprintf(makefile, "# Do not edit this Makefile by hand\n\n");
fprintf(makefile, "CC=c99\n");
@@ -30,6 +30,7 @@ static void make_header(FILE *makefile, const char *target)
fprintf(makefile, "\trm -f $(BINDIR)/%s $(OBJDIR)/*.o\n\n", target);
fprintf(makefile, "install: $(BINDIR)/%s\n", target);
+ fprintf(makefile, "\tmkdir -p $(DESTDIR)/bin\n");
fprintf(makefile, "\tcp $(BINDIR)/%s $(DESTDIR)/bin\n\n", target);
}
@@ -45,6 +46,7 @@ static void add_object(FILE *makefile, const struct majefile *src, const char *t
obj, inc->path);
}
fprintf(makefile, "$(OBJDIR)/%s: $(SRCDIR)/%s\n", obj, src->path);
+ fprintf(makefile, "\t@mkdir -p $(@D)\n");
fprintf(makefile, "\t$(CC) $(CFLAGS) -o $@ -c $(SRCDIR)/%s\n\n", src->path);
free(fullobj);
@@ -64,6 +66,7 @@ void make_makefile(const char *makepath, struct majefile *sources, const char *t
}
fprintf(makefile, "$(BINDIR)/%s:\n", target);
+ fprintf(makefile, "\t@mkdir -p $(@D)\n");
fprintf(makefile, "\t$(LD) $(LDFLAGS) -o $@ $(OBJDIR)/*.o $(LDLIBS)\n");
fclose(makefile);