Rust rewrite
This commit is contained in:
38
Makefile
38
Makefile
@@ -1,21 +1,33 @@
|
||||
BIN=./dim
|
||||
CC=gcc
|
||||
CCARGS=-Isrc/include -Wall -pedantic
|
||||
|
||||
MODULES= \
|
||||
modules/clock.dim \
|
||||
modules/battery.dim \
|
||||
modules/timesince.dim
|
||||
CWD := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
|
||||
all: $(BIN) $(MODULES) compile_commands.json
|
||||
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): src/main.c src/plug.c src/socket.c src/util.c
|
||||
$(CC) -o $@ $^ $(CCARGS) -lX11 -ldl
|
||||
BIN=$(BUILD_DIR)/dim
|
||||
|
||||
PLUGINS=$(wildcard dim_plugins/**/Makefile)
|
||||
|
||||
|
||||
modules/%.dim: src/modules/%.c
|
||||
$(CC) -o $@ $^ -rdynamic -shared -fPIC $(CCARGS)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user