diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-01-14 15:38:22 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-01-14 15:38:22 -0500 |
commit | cd2d1af8bf99ac00894df9d57e6a16f7af75b654 (patch) | |
tree | 54d70ab5b4f0a0be9aeec9413d6f770e70159bf7 | |
parent | 3c8de3caa43fd478ec1fe034be25452d3416f0b4 (diff) |
add LD and LDFLAGS
-rw-r--r-- | make.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); } |