PUD: remove debug code
[olsrd.git] / lib / pud / Makefile
1 LIBRARY_PATH = wireformat
2 JAVA_PATH = wireformat-java
3 include $(LIBRARY_PATH)/Makefile.inc
4 LIBRARY_NAME := $(PROJECT)
5
6
7 include Makefile.inc
8
9 TOPDIR = ../..
10 include $(TOPDIR)/Makefile.inc
11
12
13 CFLAGS += -Werror -D_GNU_SOURCE
14
15
16 VERSION_FILE = ./src/version.h
17 LIBRARY_INC = $(LIBRARY_PATH)/include
18 LIBRARY_LIB = $(LIBRARY_PATH)/lib
19
20 CFLAGS += -I $(LIBRARY_INC)
21 LIBS += -L $(LIBRARY_LIB) -lnmea -lm -l$(LIBRARY_NAME)
22
23 ifneq ($(OS),linux)
24
25 .PHONY: all default_target install clean
26
27 all: default_target
28
29 default_target install clean:
30         @echo "*** $(PLUGIN_NAME) plugin only supported on Linux, sorry!"
31
32 else
33
34 .PHONY: all default_target install uninstall clean doc doc-clean library java java-instal java-uninstall
35
36 all: default_target
37
38 default_target: library $(VERSION_FILE) $(PLUGIN_FULLNAME)
39
40 # repeat from toplevel Makefile.inc, and adjust: we need the library includes
41 %.d: %.c
42         @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
43
44 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
45         @echo "[LD] $@"
46         @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
47
48 $(VERSION_FILE): library scripts/makeVersionH
49         @./scripts/makeVersionH "$(VERSION_FILE)" "$(PLUGIN_VER)"
50
51 install: all
52         @$(MAKE) -C $(LIBRARY_PATH) DESTDIR=$(DESTDIR) install
53         $(INSTALL_LIB)
54         $(STRIP) "$(LIBDIR)/$(PLUGIN_FULLNAME)"
55
56 uninstall:
57         @$(MAKE) -C $(LIBRARY_PATH) DESTDIR=$(DESTDIR) uninstall
58         rm -f "$(LIBDIR)/lib$(PLUGIN_NAME).so" "$(LIBDIR)/$(PLUGIN_NAME)"
59         $(UNINSTALL_LIB)
60         rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)"
61
62 clean:
63         @echo "[$@]"
64         @rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
65         @$(MAKE) -C doc clean
66         @$(MAKE) -C $(LIBRARY_PATH) clean
67         @$(MAKE) -C $(JAVA_PATH) clean
68
69 doc:
70         @$(MAKE) -C doc all
71         @$(MAKE) -C $(LIBRARY_PATH) doc
72         @$(MAKE) -C $(JAVA_PATH) doc
73
74 doc-clean:
75         @$(MAKE) -C doc clean
76         @$(MAKE) -C $(LIBRARY_PATH) doc clean
77         @$(MAKE) -C $(JAVA_PATH) doc clean
78
79 library:
80         @$(MAKE) -C $(LIBRARY_PATH) all
81
82 java:
83         @$(MAKE) -C $(JAVA_PATH) all
84
85 java-install: java
86         @$(MAKE) -C $(JAVA_PATH) DESTDIR=$(DESTDIR) install
87
88 java-uninstall:
89         @$(MAKE) -C $(JAVA_PATH) DESTDIR=$(DESTDIR) uninstall
90
91 endif