]> git.proxmox.com Git - mirror_iproute2.git/blame - Makefile
iproute2 - Fix up and simplify variables pointing to install directories
[mirror_iproute2.git] / Makefile
CommitLineData
ed1af7e8 1ROOTDIR=$(DESTDIR)
5c434a9e
CT
2PREFIX=/usr
3LIBDIR=$(PREFIX)/lib
b514b358 4SBINDIR=/sbin
aba5acdf 5CONFDIR=/etc/iproute2
5c434a9e
CT
6DATADIR=$(PREFIX)/share
7DOCDIR=$(DATADIR)/doc/iproute2
8MANDIR=$(DATADIR)/man
e48f73d6 9ARPDDIR=/var/lib/arpd
aba5acdf 10
d1e48c7e 11# Path to db_185.h include
ed1af7e8 12DBM_INCLUDE:=$(ROOTDIR)/usr/include
d1e48c7e 13
f2e27cfb
MF
14SHARED_LIBS = y
15
5e3bb534 16DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
f2e27cfb
MF
17ifneq ($(SHARED_LIBS),y)
18DEFINES+= -DNO_SHARED_LIBS
19endif
aba5acdf 20
5c434a9e
CT
21DEFINES+=-DCONFDIR=\"$(CONFDIR)\"
22
aba5acdf
SH
23#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
24LDLIBS=-lresolv
25ADDLIB=
26
aba5acdf
SH
27#options for decnet
28ADDLIB+=dnet_ntop.o dnet_pton.o
29
30#options for ipx
31ADDLIB+=ipx_ntop.o ipx_pton.o
32
aba5acdf 33CC = gcc
b209eda9 34HOSTCC = gcc
c8610020
CT
35DEFINES += -D_GNU_SOURCE
36CCOPTS = -O2
37WFLAGS = -Wall -Wstrict-prototypes
38CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
9ddbb02e 39YACCFLAGS = -d -t -v
aba5acdf 40
761a1e60 41SUBDIRS=lib ip tc misc netem genl man
aba5acdf
SH
42
43LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
2230ac1d 44LDLIBS += $(LIBNETLINK)
aba5acdf 45
737f15f6 46all: Config
95dd5950
MF
47 @set -e; \
48 for i in $(SUBDIRS); \
adff36d7
SH
49 do $(MAKE) $(MFLAGS) -C $$i; done
50
51Config:
f35e9289 52 sh configure $(KERNEL_INCLUDE)
aba5acdf 53
aba5acdf
SH
54install: all
55 install -m 0755 -d $(DESTDIR)$(SBINDIR)
e9a05e96 56 install -m 0755 -d $(DESTDIR)$(CONFDIR)
e48f73d6 57 install -m 0755 -d $(DESTDIR)$(ARPDDIR)
aba5acdf
SH
58 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
59 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
c72238e4 60 install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
e9a05e96 61 $(DESTDIR)$(DOCDIR)/examples
c72238e4 62 install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
e9a05e96 63 $(DESTDIR)$(DOCDIR)/examples/diffserv
aba5acdf 64 @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
c72238e4 65 install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
aba5acdf 66
235ac6a4
SH
67snapshot:
68 echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
69 > include/SNAPSHOT.h
70
aba5acdf 71clean:
adff36d7
SH
72 @for i in $(SUBDIRS) doc; \
73 do $(MAKE) $(MFLAGS) -C $$i clean; done
74
82408fc1
SH
75clobber:
76 touch Config
77 $(MAKE) $(MFLAGS) clean
a6ddc206 78 rm -f Config cscope.*
adff36d7 79
87773db5 80distclean: clobber
aba5acdf 81
f6aa8e00
SH
82cscope:
83 cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
84
aba5acdf 85.EXPORT_ALL_VARIABLES: