Files
thesis-lisp/Makefile
T

27 lines
493 B
Makefile

O=build
SRCS=$(shell find src -name "*.c" -type f)
OBJS=$(SRCS:src/%.c=$(O)/%.o)
HDRS=$(shell find include -type f -name "*.h")
SRC_DIRS=$(shell find src -type d)
DIRS=$(SRC_DIRS:src/%=$(O)/%) $(O)
LISP2CC_DIR?=../lisp2cc
CFLAGS=-Iinclude \
-I$(LISP2CC_DIR)/include/core \
-Werror \
-Wall \
-Wextra
all: $(DIRS) $(O)/lisp2
clean:
rm -rf $(O)
$(DIRS):
mkdir -p $@
$(O)/lisp2: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
$(O)/%.o: src/%.c $(HDRS)
$(CC) -c $(CFLAGS) -o $@ $<