This commit was generated by cvs2svn to compensate for changes in r1650,
[iproute2.git] / Makefile
1 DESTDIR=
2 SBINDIR=/usr/sbin
3 CONFDIR=/etc/iproute2
4 DOCDIR=/usr/share/doc/iproute2
5 MANDIR=/usr/share/man
6 KERNEL_INCLUDE=/usr/include
7
8 # Path to db_185.h include
9 DBM_INCLUDE:=/usr/include
10
11 DEFINES= -DRESOLVE_HOSTNAMES
12
13 #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
14 LDLIBS=-lresolv
15 ADDLIB=
16
17 #options for decnet
18 ADDLIB+=dnet_ntop.o dnet_pton.o
19
20 #options for ipx
21 ADDLIB+=ipx_ntop.o ipx_pton.o
22
23 CC = gcc
24 HOSTCC = gcc
25 CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
26 CFLAGS = $(CCOPTS) -I../include $(DEFINES)
27
28 LDLIBS += -L../lib -lnetlink -lutil
29
30 SUBDIRS=lib ip tc misc netem
31
32 LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
33
34 all: Config
35         @for i in $(SUBDIRS); \
36         do $(MAKE) $(MFLAGS) -C $$i; done
37
38 Config:
39         ./configure $(KERNEL_INCLUDE)
40
41 install: all
42         install -m 0755 -d $(DESTDIR)$(SBINDIR)
43         install -m 0755 -d $(DESTDIR)$(CONFDIR)
44         install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
45         install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
46         install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
47                 $(DESTDIR)$(DOCDIR)/examples
48         install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
49                 $(DESTDIR)$(DOCDIR)/examples/diffserv
50         @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
51         install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
52         install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
53         install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
54         ln -sf $(MANDIR)/man8/tc-pbfifo.8  $(DESTDIR)$(MANDIR)/man8/tc-bfifo.8
55         ln -sf $(MANDIR)/man8/tc-pbfifo.8  $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
56         install -m 0755 -d $(DESTDIR)$(MANDIR)/man3
57         install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
58
59 clean:
60         @for i in $(SUBDIRS) doc; \
61         do $(MAKE) $(MFLAGS) -C $$i clean; done
62
63 clobber: clean
64         rm -f Config
65
66 distclean: clean clobber
67
68 .EXPORT_ALL_VARIABLES: