dim/dim_plugins/example_c/Makefile

20 lines
440 B
Makefile

PLUGIN_NAME=example_c
CC_FLAGS = $(DIM_CC_FLAGS) -fPIC
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 $@)
$(DIM_CC) -o $@ $^ -rdynamic -shared $(CC_FLAGS)
$(OBJECT_DIR)/$(PLUGIN_NAME)/%.o: src/%.c
@mkdir -p $(dir $@)
$(DIM_CC) -c -o $@ $< -pie $(CC_FLAGS)