diff options
Diffstat (limited to '2015/01')
-rw-r--r-- | 2015/01/Makefile | 17 | ||||
-rw-r--r-- | 2015/01/solve.c | 7 |
2 files changed, 18 insertions, 6 deletions
diff --git a/2015/01/Makefile b/2015/01/Makefile index 769d06d..57e1574 100644 --- a/2015/01/Makefile +++ b/2015/01/Makefile @@ -1,10 +1,19 @@ -.PHONY: solve.c +DEBUG = -Wno-error -Og -ggdb3 -s -fsanitize=undefined -fsanitize=address -fstack-protector-all +CFLAGS = -Wall -Wextra -Werror -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wnested-externs -Wformat=2 -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wswitch-default -Wswitch-enum -Wunreachable-code -Wundef -Wold-style-definition -Wvla -pedantic-errors -Ofast -solve.o: solve.c - @gcc $+ -o $@ +# Not the best makefile but idc + +debug: + @gcc $(CFLAGS) $(DEBUG) solve.c -o solve.o + +build: + @gcc $(CFLAGS) solve.c -o solve.o clean: @rm -f *.o -run: solve.o +run: debug + @./solve.o + +time: build @./solve.o diff --git a/2015/01/solve.c b/2015/01/solve.c index 287bf3f..81a0ec4 100644 --- a/2015/01/solve.c +++ b/2015/01/solve.c @@ -2,7 +2,7 @@ #include <stdlib.h> #include <time.h> -int part_one(FILE *fp) +static int part_one(FILE *fp) { int res = 0; @@ -17,7 +17,7 @@ int part_one(FILE *fp) return res; } -int part_two(FILE *fp) +static int part_two(FILE *fp) { int res = 0, floor = 0; @@ -39,6 +39,9 @@ int part_two(FILE *fp) int main(int argc, char *argv[]) { + (void)argc; + (void)argv; + FILE *fp = fopen("input", "r"); if (!fp) exit(EXIT_FAILURE); |