netjson: install extra (documention) files
[olsrd.git] / lib / netjson / Makefile
index 3d3a3a4..e948d56 100644 (file)
 
 OLSRD_PLUGIN = true
 PLUGIN_NAME =  olsrd_netjson
-PLUGIN_VER =   1.0
+PLUGIN_VER =   1.1
 
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
-COMMONINFO = $(wildcard ../info/*.c)
+LDFLAGS += -lm
+
+COMMONINFO = $(sort $(wildcard ../info/*.c))
 OBJS += $(COMMONINFO:%.c=%.o)
 
 default_target: $(PLUGIN_FULLNAME)
@@ -62,8 +64,16 @@ endif
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
                $(INSTALL_LIB)
+ifneq ($(DOCDIR_OLSRD),)
+               mkdir -p "$(DOCDIR_OLSRD)"
+               cp "README_NETJSON" "$(DOCDIR_OLSRD)"
+endif
 
 uninstall:
+ifneq ($(DOCDIR_OLSRD),)
+               rm -f "$(DOCDIR_OLSRD)/README_NETJSON"
+               rmdir -p --ignore-fail-on-non-empty "$(DOCDIR_OLSRD)"
+endif
                $(UNINSTALL_LIB)
 
 clean: