2024-06-14 15:22:20 +00:00
|
|
|
PLUGIN_NAME=example_c
|
|
|
|
|
|
|
|
|
2024-06-15 21:59:04 +00:00
|
|
|
CC_FLAGS = $(DIM_CC_FLAGS) -fPIC
|
2024-06-14 15:22:20 +00:00
|
|
|
|
|
|
|
SOURCES=$(wildcard src/*.c)
|
|
|
|
OBJECTS=$(patsubst src/%.c,$(OBJECT_DIR)/$(PLUGIN_NAME)/%.o,$(SOURCES))
|
|
|
|
|
|
|
|
$(info $(SOURCES))
|
|
|
|
|
|
|
|
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
|
|
|
|
|
|
|
$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECTS)
|
|
|
|
@mkdir -p $(dir $@)
|
2024-06-15 21:59:04 +00:00
|
|
|
$(DIM_CC) -o $@ $^ -rdynamic -shared $(CC_FLAGS)
|
2024-06-14 15:22:20 +00:00
|
|
|
|
|
|
|
$(OBJECT_DIR)/$(PLUGIN_NAME)/%.o: src/%.c
|
|
|
|
@mkdir -p $(dir $@)
|
2024-06-15 21:59:04 +00:00
|
|
|
$(DIM_CC) -c -o $@ $< -pie $(CC_FLAGS)
|