2 # OLSR ad-hoc routing table management protocol
3 # Copyright (C) 2003-2004 Andreas Tønnesen (andreto@ifi.uio.no)
5 # This file is part of the olsr.org OLSR daemon.
7 # olsr.org is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # olsr.org is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with olsr.org; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # $Id: Makefile,v 1.13 2004/11/05 09:31:46 kattemat Exp $
37 CFGDIR = src/cfgparser
40 DEPEND = makedepend -f $(DEPFILE)
42 SRCS = $(wildcard src/*.c) \
43 $(CFGDIR)/oparse.c $(CFGDIR)/oscan.c $(CFGDIR)/olsrd_conf.c
45 HDRS = $(wildcard src/*.h) \
46 $(CFGDIR)/oparse.h $(CFGDIR)/olsrd_conf.h
48 OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) \
49 $(CFGDIR)/oparse.o $(CFGDIR)/oscan.o $(CFGDIR)/olsrd_conf.o
53 SRCS += $(wildcard src/linux/*.c) $(wildcard src/unix/*.c)
55 HDRS += $(wildcard src/linux/*.h) $(wildcard src/unix/*.h)
57 OBJS += $(patsubst %.c,%.o,$(wildcard src/linux/*.c)) \
58 $(patsubst %.c,%.o,$(wildcard src/unix/*.c))
60 CFLAGS ?= -Isrc -Wall -Wmissing-prototypes -Wstrict-prototypes \
61 -O2 -g -Dlinux #-pg -DDEBUG #-march=i686
63 LIBS = -lpthread -lm -ldl
68 SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c)
70 HDRS += $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h)
72 OBJS += $(patsubst %.c,%.o,$(wildcard src/bsd/*.c)) \
73 $(patsubst %.c,%.o,$(wildcard src/unix/*.c))
75 CFLAGS ?= -Isrc -Wall -Wmissing-prototypes -Wstrict-prototypes \
84 SRCS += $(wildcard src/win32/*.c)
86 HDRS += $(wildcard src/win32/*.h)
88 OBJS += $(patsubst %.c,%.o,$(wildcard src/win32/*.c))
90 CFLAGS ?= -Isrc -Isrc/win32 -Wall -Wmissing-prototypes \
91 -Wstrict-prototypes -mno-cygwin -O2 -g -DWIN32
93 LIBS = -mno-cygwin -lws2_32 -liphlpapi
100 $(CC) -o bin/$@ $(OBJS) $(LIBS)
105 @echo '# olsrd dependency file. AUTOGENERATED' > $(DEPFILE)
106 $(DEPEND) -Y $(CFLAGS) $(SRCS)
108 $(CFGDIR)/oparse.c: \
109 $(CFGDIR)/oparse.y $(CFGDIR)/olsrd_conf.h
110 $(BISON) -d -o$(CFGDIR)/oparse.c $(CFGDIR)/oparse.y
112 $(CFGDIR)/oparse.h: \
116 $(CFGDIR)/oscan.lex $(CFGDIR)/oparse.h $(CFGDIR)/olsrd_conf.h
117 $(FLEX) -o$(CFGDIR)/oscan.c $(CFGDIR)/oscan.lex
126 $(MAKE) -C $$i clean; \
135 rm -f $(OBJS) $(DEPFILE)
136 rm -f $(CFGDIR)/oscan.c $(CFGDIR)/oparse.h $(CFGDIR)/oparse.c
138 rm -f src/*~ src/linux/*~ src/unix/*~ src/win32/*~
139 rm -f src/bsd/*~ src/cfgparser/*~
143 $(MAKE) -C $$i LIBDIR=$(PREFIX)/usr/lib install; \
148 install -D -m 755 bin/olsrd $(PREFIX)/usr/sbin/olsrd
151 @echo olsrd uses the configfile $(PREFIX)/etc/olsr.conf
152 @echo a default configfile. A sample configfile
153 @echo can be installed
154 mkdir -p $(PREFIX)/etc
155 cp -i files/olsrd.conf.default $(PREFIX)/etc/olsrd.conf
156 @echo -------------------------------------------
157 @echo Edit $(PREFIX)/etc/olsrd.conf before running olsrd!!
158 @echo -------------------------------------------
159 mkdir -p $(PREFIX)/usr/share/man/man8/
160 cp files/olsrd.8.gz $(PREFIX)/usr/share/man/man8/olsrd.8.gz