-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 760 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 760 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
CC := g++
LD := g++
CC_FLAGS := -std=c++20 -Wall -Wextra -Wpedantic -MMD -MP -O3
CC_INCLUDES := -I./include -I./libs/inja/include -I./libs/json/include
CC_DEFINES :=
LD_FLAGS :=
LD_LIBS := -lLLVM -lclang-cpp
SRC_DIR := src src/AST
OBJ_DIR := bin/obj
SRC := $(wildcard $(addsuffix /*.cpp, $(SRC_DIR)))
OBJ := $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(SRC)))
OUT_NAME := transformer
OUT_DIR := ./bin/
OUT := $(addprefix $(OUT_DIR), $(OUT_NAME))
all: libs
@$(MAKE) --no-print-directory --jobs 8 $(OUT)
$(OUT): $(OBJ)
@mkdir --parent $(@D)
$(LD) $(LD_FLAGS) $^ $(LD_LIBS) -o $(OUT)
$(OBJ_DIR)/%.o: %
@mkdir --parent $(@D)
$(CC) $(CC_FLAGS) $(CC_INCLUDES) $(CC_DEFINES) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -rf $(OUT_DIR)
-include $(OBJ:.o=.d)