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