-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 778 Bytes
/
Makefile
File metadata and controls
44 lines (32 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Callum Gran 2023
# See LICENSE for license info
OBJDIR = .obj
SRC = src
DIRS := $(shell find $(SRC) -type d)
SRCS := $(shell find $(SRC) -type f -name "*.c")
OBJS := $(SRCS:%.c=$(OBJDIR)/%.o)
CFLAGS = -Iinclude -Wall -Wextra -Wshadow -std=c11 -g
CFLAGS += -DLOGGING
LDFLAGS = -pthread -g
LDLIBS = -lm -lmysqlclient
.PHONY: format clean tags bear $(OBJDIR)
TARGET = json_mapper
all: $(TARGET)
$(OBJDIR)/%.o: %.c Makefile | $(OBJDIR)
@echo [CC] $@
@$(CC) -c $(CFLAGS) $< -o $@
$(TARGET): $(OBJS)
@echo [LD] $@
@$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(OBJDIR):
$(foreach dir, $(DIRS), $(shell mkdir -p $(OBJDIR)/$(dir)))
debug: CFLAGS += -g -DDEBUG
debug: $(TARGET)
clean:
rm -rf $(OBJDIR) $(TARGET)
tags:
@ctags -R
bear:
@bear -- make
format:
python format.py