summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2009-06-12 00:55:43 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:06 +0100
commitd52391fee07e13b2a9e015d4a5a57135d0356d10 (patch)
tree6a7486f250cb3d77c861c87dc8d91a5846eb5f3a /plugin
parent24d49a7cdd93a6cb8633cff062201e6b1ea6f164 (diff)
downloadfribid-d52391fee07e13b2a9e015d4a5a57135d0356d10.tar.gz
fribid-d52391fee07e13b2a9e015d4a5a57135d0356d10.tar.bz2
fribid-d52391fee07e13b2a9e015d4a5a57135d0356d10.zip
Added install/uninstall targets to the makefiles
Diffstat (limited to 'plugin')
-rw-r--r--plugin/Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugin/Makefile b/plugin/Makefile
index 5386cfd..39fe29d 100644
--- a/plugin/Makefile
+++ b/plugin/Makefile
@@ -2,6 +2,12 @@
COMMONCFLAGS=-O2 -g -Wall -Wextra -std=c99 -pedantic -Wno-unused-parameter
CCFLAGS=$(COMMONCFLAGS) -I../npapi/include -fPIC -fvisibility=hidden
+# Files to be installed
+LIB_PATH=`../configure --internal--get-define=LIB_PATH`
+NPAPI_PLUGIN_LIB=`../configure --internal--get-define=NPAPI_PLUGIN_LIB`
+NPAPI_PLUGIN_LINK=`../configure --internal--get-define=NPAPI_PLUGIN_LINK`
+NPAPI_PLUGIN_REL=`../configure --internal--get-define=NPAPI_PLUGIN_REL`
+
OBJECTS=ipc.o npmain.o npobject.o plugin.o pipe.o npn_gate.o np_entry.o
all: libplugins.so
@@ -18,10 +24,20 @@ plugin.o: plugin.h
libplugins.so: $(OBJECTS)
$(CC) -shared -Wl,-z,defs,-soname,libplugins.so -o $@ $(OBJECTS) -lc
-.PHONY: all clean
+.PHONY: all clean install uninstall
clean:
-rm -f $(OBJECTS) libplugins.so
+install:
+ install -T -D -s -m 644 libplugins.so $(NPAPI_PLUGIN_LIB) && \
+ ../configure --internal--remove-link $(NPAPI_PLUGIN_LINK) $(NPAPI_PLUGIN_REL) && \
+ ln -s $(NPAPI_PLUGIN_REL) $(NPAPI_PLUGIN_LINK)
+
+uninstall:
+ rm -f $(NPAPI_PLUGIN_LIB)
+ [ ! -d $(LIB_PATH) ] || rmdir $(LIB_PATH) 2> /dev/null || true
+ ../configure --internal--remove-link $(NPAPI_PLUGIN_LINK) $(NPAPI_PLUGIN_REL)
+
$(OBJECTS): ../common/defines.h ../common/config.h
../common/config.h:
@echo "You must run ./configure first." >&2 && false