dim/Makefile

40 lines
675 B
Makefile
Raw Normal View History

2024-06-14 15:22:20 +00:00
CWD := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
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)sdk/c_cxx
2024-06-14 15:22:20 +00:00
DIM_CC = gcc
2024-06-14 15:22:20 +00:00
BIN=$(BUILD_DIR)/dim
2024-06-14 15:22:20 +00:00
PLUGINS=$(wildcard dim_plugins/**/Makefile)
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 $@) \
2024-06-14 15:22:20 +00:00
-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)"
compile_commands.json:
compiledb -n make