]> git.proxmox.com Git - mirror_iproute2.git/blob - Makefile
Cleaner way to configure
[mirror_iproute2.git] / Makefile
1 DESTDIR=
2 SBINDIR=/usr/sbin
3 CONFDIR=/etc/iproute2
4 DOCDIR=/usr/doc/iproute2
5
6 # Path to parent kernel include files directory
7 KERNEL_INCLUDE:=/usr/include
8
9 DEFINES= -DRESOLVE_HOSTNAMES
10
11 #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
12 LDLIBS=-lresolv
13 ADDLIB=
14
15 #options for decnet
16 ADDLIB+=dnet_ntop.o dnet_pton.o
17
18 #options for ipx
19 ADDLIB+=ipx_ntop.o ipx_pton.o
20
21 CC = gcc
22 CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
23 CFLAGS = $(CCOPTS) -I$(KERNEL_INCLUDE) -I../include $(DEFINES)
24
25 LDLIBS += -L../lib -lnetlink -lutil
26
27 SUBDIRS=lib ip tc misc
28
29 LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
30
31 all: Config
32 @for i in $(SUBDIRS); \
33 do $(MAKE) $(MFLAGS) -C $$i; done
34
35 Config:
36 ./configure $(KERNEL_INCLUDE)
37
38 install: all
39 install -m 0755 -d $(DESTDIR)$(SBINDIR)
40 install -m 0755 -d $(CONFDIR)
41 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
42 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
43 install -m 0644 README.iproute2+tc $(shell find examples -type f -maxdepth 1) $(DESTDIR)$(DOCDIR)/examples
44 install -m 0644 $(shell echo examples/diffserv/*) $(DESTDIR)$(DOCDIR)/examples/diffserv
45 @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
46 @cd etc/iproute2; for i in *; do \
47 if [ ! -e $(CONFDIR)/$$i ]; then \
48 echo install -m 0644 $$i $(CONFDIR); \
49 install -m 0644 $$i $(CONFDIR); fi; done
50
51 clean:
52 @for i in $(SUBDIRS) doc; \
53 do $(MAKE) $(MFLAGS) -C $$i clean; done
54
55 clobber: clean
56 rm -f Config
57
58
59 .EXPORT_ALL_VARIABLES: