advent2019

Advent of Code 2019 (C99)
git clone git://bsandro.tech/advent2019
Log | Files | Refs | LICENSE

Makefile (389B)


      1 .SUFFIXES:
      2 MAKEFLAGS+=-rR
      3 CFLAGS=-std=c99 -Wpedantic -Wall -Wextra -ffast-math -I.
      4 ifeq (${DEBUG},1)
      5 CFLAGS+=-O0 -g
      6 else
      7 CFLAGS+=-O3 -mtune=native -march=native
      8 endif
      9 LDFLAGS=-lc -lm -flto
     10 CC=clang
     11 
     12 .PHONY: clean
     13 
     14 %+run: %.bin
     15 	./$< < inputs/$*.txt
     16 
     17 %+test: %.bin
     18 	./$< < inputs/$*_test.txt
     19 
     20 .SECONDARY:
     21 %: %.bin
     22 	@:
     23 
     24 %.bin: %.c
     25 	${CC} $< $(CFLAGS) $(LDFLAGS) -o $@
     26 
     27 clean:
     28 	rm -f ./*.bin