day 25: fic Makefile for only one part
This commit is contained in:
@@ -45,7 +45,7 @@ export PATH := .:$(PATH)
|
|||||||
|
|
||||||
.PHONY: clean all compile assembly memcheck memcheck1 memcheck2 ex1 ex2
|
.PHONY: clean all compile assembly memcheck memcheck1 memcheck2 ex1 ex2
|
||||||
|
|
||||||
all: ex1
|
all: ex1 ex2
|
||||||
|
|
||||||
memcheck: memcheck1
|
memcheck: memcheck1
|
||||||
|
|
||||||
@@ -62,8 +62,8 @@ assembly: aoc-c.s
|
|||||||
ex1: aoc-c
|
ex1: aoc-c
|
||||||
@$(TIME) aoc-c -p 1 < $(INPUT)
|
@$(TIME) aoc-c -p 1 < $(INPUT)
|
||||||
|
|
||||||
ex2: aoc-c
|
ex2: day_25a
|
||||||
@$(TIME) aoc-c -p 2 < $(INPUT)
|
@$(TIME) day_25a $(INPUT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f aoc-c core* vgcore* gmon.out aoc-c.s
|
@rm -f aoc-c core* vgcore* gmon.out aoc-c.s
|
||||||
|
@@ -141,7 +141,7 @@ static struct map *read_input()
|
|||||||
ssize_t buflen;
|
ssize_t buflen;
|
||||||
struct map *map;
|
struct map *map;
|
||||||
|
|
||||||
/* use calloc() to ensure cur & next are set to NULL */
|
/* use calloc() to ensure cur & next are set to NULL */
|
||||||
if (!(map = calloc(1, sizeof(struct map))))
|
if (!(map = calloc(1, sizeof(struct map))))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ static struct map *read_input()
|
|||||||
if (!(map->next = strdup(map->cur)))
|
if (!(map->next = strdup(map->cur)))
|
||||||
goto freemem;
|
goto freemem;
|
||||||
map->ncols = strchr(map->cur, '\n') - map->cur;
|
map->ncols = strchr(map->cur, '\n') - map->cur;
|
||||||
/* next line works if there is nothing after the last input data last line,
|
/* next line works if there is nothing after the last input data last line,
|
||||||
* i.e. if last char of input (at position bufflen - 1) is the '\n' on the
|
* i.e. if last char of input (at position bufflen - 1) is the '\n' on the
|
||||||
* last valid puzzle line.
|
* last valid puzzle line.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user