summaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: 6a7bfd2bfe10cb361ac9948df4a03b4a0f44d46e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# src/Makefile
#
# 	This library is free software; you can redistribute it and/or
#	modify it under the terms of the GNU Lesser General Public
#	License as published by the Free Software Foundation version 2.1
#	of the License.
#
# Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
#

ifeq ($(shell [ ! -r ../Makefile.opts ] && echo 1),)
    include ../Makefile.opts
endif

LDFLAGS	+= -L../lib -lnl
CIN 	:= $(wildcard nl-*.c) $(wildcard genl-*.c) $(wildcard nf-*.c)
TOOLS	:= $(CIN:%.c=%)

all: $(TOOLS)

$(TOOLS): utils.o
nl-route-add nl-route-delete nl-route-list: route-utils.o rtnl-utils.o
nl-route-get: rtnl-utils.o
nl-addr-add nl-addr-delete nl-addr-list: addr-utils.o rtnl-utils.o
nl-link-list nl-link-set nl-link-stats: link-utils.o rtnl-utils.o
nl-link-ifindex2name nl-link-name2ifindex: rtnl-utils.o
nl-neigh-add nl-neigh-delete nl-neigh-list: neigh-utils.o rtnl-utils.o
nl-qdisc-delete nl-qdisc-list: qdisc-utils.o rtnl-utils.o
nl-rule-list: rule-utils.o rtnl-utils.o
nl-neightbl-list: rtnl-utils.o
nl-monitor: rtnl-utils.o
nl-tctree-list: rtnl-utils.o

genl-ctrl-list: ctrl-utils.o

nf-ct-list: ct-utils.o
nf-log: log-utils.o rtnl-utils.o
nf-queue: queue-utils.o rtnl-utils.o

nl-%: nl-%.o
	@echo "  LD $@"; \
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-route

genl-%: genl-%.o
	@echo "  LD $@"; \
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-genl

nf-%: nf-%.o
	@echo "  LD $@"; \
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-nf -lnl-route

clean:
	@echo "  CLEAN src"; \
	rm -f $(TOOLS) *.o

distclean: clean

install:
	@true

include ../Makefile.rules