Added strict prototype checking
[olsrd.git] / Makefile
1 CC ?= gcc
2
3 CFLAGS ?= -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -g #-pg -DDEBUG #-march=i686
4 LIBS = -lpthread -lm -ldl
5 INSTALL_PREFIX ?=
6 STRIP ?= strip
7
8 # Keep OS specific files last
9
10 SRCS=   src/interfaces.c src/parser.c src/build_msg.c \
11         src/scheduler.c src/main.c src/two_hop_neighbor_table.c \
12         src/neighbor_table.c src/mpr_selector_set.c src/duplicate_set.c \
13         src/tc_set.c src/routing_table.c src/packet.c src/olsr.c \
14         src/process_routes.c src/net.c src/mantissa.c \
15         src/hna_set.c src/mid_set.c src/ipc_frontend.c \
16         src/link_set.c src/configfile.c src/socket_parser.c \
17         src/process_package.c src/mpr.c src/local_hna_set.c \
18         src/hashing.c src/hysteresis.c src/generate_msg.c \
19         src/rebuild_packet.c src/plugin_loader.c src/plugin.c \
20         src/linux/net.c src/linux/apm.c src/linux/tunnel.c \
21         src/linux/kernel_routes.c src/linux/link_layer.c \
22         src/linux/ifnet.c src/linux/log.c
23
24 OBJS=   src/interfaces.o src/parser.o src/build_msg.o \
25         src/scheduler.o src/main.o src/two_hop_neighbor_table.o \
26         src/neighbor_table.o src/mpr_selector_set.o src/duplicate_set.o \
27         src/tc_set.o src/routing_table.o src/packet.o src/olsr.o \
28         src/process_routes.o src/net.o src/mantissa.o \
29         src/hna_set.o src/mid_set.o src/ipc_frontend.o \
30         src/link_set.o src/configfile.o src/socket_parser.o \
31         src/process_package.o src/mpr.o src/local_hna_set.o\
32         src/hashing.o src/hysteresis.o src/generate_msg.o \
33         src/rebuild_packet.o src/plugin_loader.o src/plugin.o \
34         src/linux/net.o src/linux/apm.o src/linux/tunnel.o \
35         src/linux/kernel_routes.o src/linux/link_layer.o \
36         src/linux/ifnet.o src/linux/log.o
37
38 HDRS=   src/defs.h src/interfaces.h src/packet.h src/build_msg.h \
39         src/olsr.h src/two_hop_neighbor_table.h olsr_plugin_io.h \
40         src/neighbor_table.h src/mpr_selector_set.h \
41         src/duplicate_set.h src/tc_set.h src/rtable.h \
42         src/process_routes.h src/net.h src/mantissa.h \
43         src/hna_set.h main.h src/mid_set.h src/ipc_frontend.h \
44         src/olsr_protocol.h src/link_set.h src/configfile.h \
45         src/process_package.h src/mpr.h src/ipc_olsrset.h \
46         src/local_hna_set.h src/hashing.h src/hysteresis.h \
47         src/generate_msg.h src/rebuild_packet.h src/plugin_loader.h \
48         src/plugin.h src/socket_parser.h src/ifnet.h \
49         src/kernel_routes.h src/log.h src/net_os.h \
50         src/apm.h src/linux/tunnel.h src/scheduler.h \
51         src/linux/net.h src/linux/link_layer.h
52
53 all:    olsrd
54
55 olsrd:  $(OBJS)
56         $(CC) $(LIBS) -o bin/$@ $(OBJS)
57
58 libs: 
59         for i in lib/*; do \
60                 $(MAKE) -C $$i; \
61         done; 
62
63 clean_libs: 
64         for i in lib/*; do \
65                 $(MAKE) -C $$i clean; \
66         done; 
67
68 .PHONY: clean
69 clean:
70         -rm -f $(OBJS)
71
72 install_libs:
73         for i in lib/*; do \
74                 $(MAKE) -C $$i LIBDIR=$(INSTALL_PREFIX)/usr/lib install; \
75         done;   
76
77
78 install_bin:
79         $(STRIP) bin/olsrd
80         install -D -m 755 bin/olsrd $(INSTALL_PREFIX)/usr/sbin/olsrd
81
82 install: install_bin
83         @echo olsrd uses the configfile $(INSTALL_PREFIX)/etc/olsr.conf
84         @echo a default configfile. A sample configfile
85         @echo can be installed
86         mkdir -p $(INSTALL_PREFIX)/etc
87         cp -i files/olsrd.conf.default $(INSTALL_PREFIX)/etc/olsrd.conf
88         @echo -------------------------------------------
89         @echo Edit $(INSTALL_PREFIX)/etc/olsrd.conf before running olsrd!!
90         @echo -------------------------------------------
91         mkdir -p $(INSTALL_PREFIX)/usr/share/man/man8/
92         cp files/olsrd.8.gz $(INSTALL_PREFIX)/usr/share/man/man8/olsrd.8.gz