2024-06-14 15:22:20 +00:00
|
|
|
CWD := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
2024-05-19 12:58:35 +00:00
|
|
|
|
|
|
|
|
2024-06-14 15:22:20 +00:00
|
|
|
PLUGIN_DIR = ${CWD}plugins
|
|
|
|
OBJECT_DIR = $(CWD)target/objects
|
|
|
|
BUILD_DIR = $(CWD)target
|
|
|
|
DIM_CC_FLAGS = -I$(CWD)include -rdynamic -shared -fPIC
|
|
|
|
DIM_CC = gcc
|
2024-05-19 12:58:35 +00:00
|
|
|
|
2024-06-14 15:22:20 +00:00
|
|
|
BIN=$(BUILD_DIR)/dim
|
2024-05-19 12:58:35 +00:00
|
|
|
|
2024-06-14 15:22:20 +00:00
|
|
|
PLUGINS=$(wildcard dim_plugins/**/Makefile)
|
2024-05-19 12:58:35 +00:00
|
|
|
|
|
|
|
|
2024-06-14 15:22:20 +00:00
|
|
|
all: $(BIN) $(PLUGINS) compile_commands.json
|
|
|
|
|
|
|
|
$(BIN): target/release/dim
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
target/release/dim:
|
|
|
|
cargo build --release
|
|
|
|
|
|
|
|
dim_plugins/%/Makefile:
|
|
|
|
$(MAKE) -C $(dir $@) \
|
|
|
|
-E "PLUGIN_DIR=$(PLUGIN_DIR)" \
|
|
|
|
-E "OBJECT_DIR=$(OBJECT_DIR)" \
|
|
|
|
-E "BUILD_DIR=$(BUILD_DIR)" \
|
|
|
|
-E "DIM_CC_FLAGS=$(DIM_CC_FLAGS)" \
|
|
|
|
-E "DIM_CC=$(DIM_CC)"
|
|
|
|
|
2024-05-19 12:58:35 +00:00
|
|
|
|
|
|
|
compile_commands.json:
|
|
|
|
compiledb -n make
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|