summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-01-14 15:38:22 -0500
committerJakob Kaivo <jkk@ung.org>2020-01-14 15:38:22 -0500
commitcd2d1af8bf99ac00894df9d57e6a16f7af75b654 (patch)
tree54d70ab5b4f0a0be9aeec9413d6f770e70159bf7
parent3c8de3caa43fd478ec1fe034be25452d3416f0b4 (diff)
add LD and LDFLAGS
-rw-r--r--make.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/make.c b/make.c
index 919cac8..7983979 100644
--- a/make.c
+++ b/make.c
@@ -16,7 +16,10 @@ static void make_header(FILE *makefile, const char *target)
fprintf(makefile, "default: all\n\n");
fprintf(makefile, "CC=c99\n");
- fprintf(makefile, "CFLAGS=-Wall -Wextra -Wpedantic -Werror -g\n\n");
+ fprintf(makefile, "LD=$(CC)\n");
+ fprintf(makefile, "CFLAGS=-Wall -Wextra -Wpedantic -Werror -g\n");
+ fprintf(makefile, "LDFLAGS=\n");
+ fprintf(makefile, "\n");
fprintf(makefile, "all: %s\n\n", target);
@@ -51,7 +54,7 @@ void make_makefile(const char *makepath, char **sources, const char *target)
}
fprintf(makefile, "%s:\n", target);
- fprintf(makefile, "\t$(CC) -o $@ *.o\n");
+ fprintf(makefile, "\t$(LD) $(LDFLAGS) -o $@ *.o\n");
fclose(makefile);
}