2020-10-28 15:30:54 +01:00
|
|
|
CC = gcc
|
|
|
|
CPPFLAGS = -Isrc/ -D_POSIX_C_SOURCE=200809L
|
|
|
|
CFLAGS = -Wall -Wextra -pedantic -Werror -std=c99
|
|
|
|
VPATH = src/
|
|
|
|
|
|
|
|
SRC = \
|
|
|
|
src/ast/ast.c \
|
|
|
|
src/eval/eval.c \
|
2020-10-28 17:09:44 +01:00
|
|
|
src/parse/climbing_parse.c \
|
2020-10-28 17:09:22 +01:00
|
|
|
src/parse/recursive_parse.c \
|
2020-10-28 15:30:54 +01:00
|
|
|
|
|
|
|
BIN = evalexpr
|
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
# Write this one rule instead of using the implicit rules to buid at the root
|
|
|
|
$(BIN): $(OBJ) src/evalexpr.o
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJ) # remove object files
|
|
|
|
$(RM) $(BIN) # remove main program
|