2020-11-08 16:55:12 +01:00
|
|
|
CC = gcc
|
|
|
|
CPPFLAGS = -Isrc/ -D_POSIX_C_SOURCE=200809L
|
|
|
|
CFLAGS = -Wall -Wextra -pedantic -Werror -std=c99
|
2020-11-08 16:57:38 +01:00
|
|
|
VPATH = src/ tests/
|
2020-11-08 16:55:12 +01:00
|
|
|
USE_CLIMBING = 1
|
|
|
|
|
|
|
|
SRC = \
|
|
|
|
src/eval.c \
|
|
|
|
|
|
|
|
BIN = pratt
|
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
$(BIN):
|
|
|
|
$(BIN): $(OBJ) src/pratt.o
|
|
|
|
|
2020-11-08 16:57:38 +01:00
|
|
|
check: testsuite
|
|
|
|
./testsuite --verbose
|
|
|
|
|
|
|
|
TEST_SRC = \
|
|
|
|
tests/testsuite.c \
|
|
|
|
|
|
|
|
TEST_OBJ = $(TEST_SRC:.c=.o)
|
|
|
|
|
|
|
|
testsuite: LDFLAGS+=-lcriterion -fsanitize=address
|
|
|
|
testsuite: CFLAGS+=-fsanitize=address
|
|
|
|
testsuite: $(OBJ) $(TEST_OBJ)
|
|
|
|
|
2020-11-08 16:55:12 +01:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJ) # remove object files
|
|
|
|
$(RM) $(BIN) # remove main program
|
2020-11-08 16:57:38 +01:00
|
|
|
$(RM) testsuite
|