1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#Copyright (C) 2007 L. Donnie Smith
LIB_NAME = $(PLUGIN_NAME).so
OBJECTS = $(SOURCES:.c=.o)
DEPS = $(SOURCES:.c=.d)
CFLAGS += -fpic
#TODO:unify the way ROOTDIR is handled
#Currently, defs.mak adds ROOTDIR to the plugin INST_DIR,
#so we don't do it here
#DEST_INST_DIR = $(ROOTDIR)/$(INST_DIR)
DEST_INST_DIR = $(INST_DIR)
all: $(LIB_NAME)
$(LIB_NAME): $(OBJECTS)
$(CC) -shared $(LDFLAGS) $(LDLIBS) -o $(LIB_NAME) $(OBJECTS)
install: $(LIB_NAME)
install -D $(LIB_NAME) $(DEST_INST_DIR)/$(LIB_NAME)
clean:
rm -f $(LIB_NAME) $(OBJECTS) $(DEPS)
uninstall:
rm -f $(INST_DIR)/$(LIB_NAME)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
include $(COMMON)/include/dep.mak
-include $(DEPS)
endif
endif
.PHONY: all install clean uninstall
|