]> git.proxmox.com Git - mirror_iproute2.git/blame - Makefile
lib: make string arguments const
[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 for decnet
24ADDLIB+=dnet_ntop.o dnet_pton.o
25
26#options for ipx
27ADDLIB+=ipx_ntop.o ipx_pton.o
28
aba5acdf 29CC = gcc
b209eda9 30HOSTCC = gcc
c8610020
CT
31DEFINES += -D_GNU_SOURCE
32CCOPTS = -O2
5a650703 33WFLAGS = -Wall -Wstrict-prototypes -Werror
c8610020 34CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
9ddbb02e 35YACCFLAGS = -d -t -v
aba5acdf 36
d04bc300 37SUBDIRS=lib ip tc bridge misc netem genl man
aba5acdf
SH
38
39LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
2230ac1d 40LDLIBS += $(LIBNETLINK)
aba5acdf 41
737f15f6 42all: Config
95dd5950
MF
43 @set -e; \
44 for i in $(SUBDIRS); \
adff36d7
SH
45 do $(MAKE) $(MFLAGS) -C $$i; done
46
47Config:
f35e9289 48 sh configure $(KERNEL_INCLUDE)
aba5acdf 49
aba5acdf
SH
50install: all
51 install -m 0755 -d $(DESTDIR)$(SBINDIR)
e9a05e96 52 install -m 0755 -d $(DESTDIR)$(CONFDIR)
e48f73d6 53 install -m 0755 -d $(DESTDIR)$(ARPDDIR)
aba5acdf
SH
54 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
55 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
c72238e4 56 install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
e9a05e96 57 $(DESTDIR)$(DOCDIR)/examples
c72238e4 58 install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
e9a05e96 59 $(DESTDIR)$(DOCDIR)/examples/diffserv
aba5acdf 60 @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
c72238e4 61 install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
aba5acdf 62
235ac6a4
SH
63snapshot:
64 echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
65 > include/SNAPSHOT.h
66
aba5acdf 67clean:
adff36d7
SH
68 @for i in $(SUBDIRS) doc; \
69 do $(MAKE) $(MFLAGS) -C $$i clean; done
70
82408fc1
SH
71clobber:
72 touch Config
73 $(MAKE) $(MFLAGS) clean
a6ddc206 74 rm -f Config cscope.*
adff36d7 75
87773db5 76distclean: clobber
aba5acdf 77
f6aa8e00
SH
78cscope:
79 cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
80
aba5acdf 81.EXPORT_ALL_VARIABLES: