dim/Makefile
2024-06-14 18:22:20 +03:00

40 lines
695 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)include -rdynamic -shared -fPIC
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