sgwdynspeed: add plugin
[olsrd.git] / lib / sgwdynspeed / Makefile
1 include Makefile.inc
2
3 TOPDIR = ../..
4 include $(TOPDIR)/Makefile.inc
5
6
7 CFLAGS += -Werror
8
9 RESOURCESDIR = ./resources
10
11 ifneq ($(OS),linux)
12
13 .PHONY: all default_target install clean
14
15 all: default_target
16
17 default_target install clean:
18         @echo "*** $(PLUGIN_NAME) plugin only supported on Linux, sorry!"
19
20 else
21
22 GIT_SHA = $(shell git describe 2> /dev/null || echo "Unknown")
23 CFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" -DPLUGIN_VER=\"$(PLUGIN_VER)\"
24
25 .PHONY: all default_target install uninstall clean doc doc-clean java java-instal java-uninstall
26
27 all: default_target
28
29 default_target: $(PLUGIN_FULLNAME)
30
31 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
32         @echo "[LD] $@"
33         @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
34
35 install: all
36         $(INSTALL_LIB)
37         mkdir -p "$(ETCDIR)"
38         cp "$(RESOURCESDIR)/olsrd.sgw.speed.conf" "$(ETCDIR)"
39         $(STRIP) "$(LIBDIR)/$(PLUGIN_FULLNAME)"
40
41 uninstall:
42         rm -f "$(LIBDIR)/lib$(PLUGIN_NAME).so" "$(LIBDIR)/$(PLUGIN_NAME)" "$(ETCDIR)/olsrd.sgw.speed.conf"
43         $(UNINSTALL_LIB)
44         rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)" "$(ETCDIR)"
45
46 clean:
47         @echo "[$@]"
48         @rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
49         @$(MAKE) -C doc clean
50
51 doc:
52         @$(MAKE) -C doc all
53
54 doc-clean:
55         @$(MAKE) -C doc clean
56
57 endif