dim/Makefile

40 lines
675 B
Makefile

CWD := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
PLUGIN_DIR = ${CWD}plugins
OBJECT_DIR = $(CWD)target/objects
BUILD_DIR = $(CWD)target
DIM_CC_FLAGS = -I$(CWD)sdk/c_cxx
DIM_CC = gcc
BIN=$(BUILD_DIR)/dim
PLUGINS=$(wildcard dim_plugins/**/Makefile)
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)"
compile_commands.json:
compiledb -n make