blob: 37d556dd9790d38993d10f74574fd45abd3e4eaf [file] [log] [blame]
Glenn L McGrath9a2d2722002-11-10 01:33:55 +00001# Makefile for busybox
2#
Eric Andersenc7bda1c2004-03-15 08:29:22 +00003# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Glenn L McGrath9a2d2722002-11-10 01:33:55 +00004#
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +00005# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
Glenn L McGrath9a2d2722002-11-10 01:33:55 +00006#
7
8LIBIPROUTE_AR:=libiproute.a
9ifndef $(LIBIPROUTE_DIR)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000010LIBIPROUTE_DIR:=$(top_builddir)/networking/libiproute
Glenn L McGrath9a2d2722002-11-10 01:33:55 +000011endif
Eric Andersen7daa0762004-10-08 07:46:08 +000012srcdir=$(top_srcdir)/networking/libiproute
Glenn L McGrath9a2d2722002-11-10 01:33:55 +000013
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000014LIBIPROUTE-y:=
Glenn L McGrath8ae75012002-11-10 10:20:45 +000015LIBIPROUTE-$(CONFIG_IP) += \
Glenn L McGrathf112daa2002-12-01 23:04:06 +000016 ip_parse_common_args.o \
Glenn L McGrath9a2d2722002-11-10 01:33:55 +000017 ipaddress.o \
18 iplink.o \
19 iproute.o \
20 iptunnel.o \
21 libnetlink.o \
22 ll_addr.o \
23 ll_map.o \
24 ll_proto.o \
25 ll_types.o \
26 rt_names.o \
27 rtm_map.o \
28 utils.o
29
Glenn L McGrath36c74782004-04-12 02:22:39 +000030LIBIPROUTE-$(CONFIG_IPADDR) += \
31 ip_parse_common_args.o \
32 ipaddress.o \
33 libnetlink.o \
34 ll_addr.o \
35 ll_map.o \
36 ll_types.o \
37 rt_names.o \
38 utils.o
39
40LIBIPROUTE-$(CONFIG_IPLINK) += \
41 ip_parse_common_args.o \
42 ipaddress.o \
43 iplink.o \
44 libnetlink.o \
45 ll_addr.o \
46 ll_map.o \
47 ll_types.o \
48 rt_names.o \
49 utils.o
50
51LIBIPROUTE-$(CONFIG_IPROUTE) += \
52 ip_parse_common_args.o \
53 iproute.o \
54 libnetlink.o \
55 ll_map.o \
56 rt_names.o \
57 rtm_map.o \
58 utils.o
59
60LIBIPROUTE-$(CONFIG_IPTUNNEL) += \
61 ip_parse_common_args.o \
62 iptunnel.o \
63 rt_names.o \
64 utils.o
65
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000066LIBIPROUTE-y:=$(sort $(LIBIPROUTE-y))
Glenn L McGrath9a2d2722002-11-10 01:33:55 +000067
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000068LIBIPROUTE_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBIPROUTE-y)))
69LIBIPROUTE_SRC-a:=$(wildcard $(srcdir)/*.c)
70LIBRARY_SRC-y+=$(LIBIPROUTE_SRC-y)
71LIBRARY_SRC-a+=$(LIBIPROUTE_SRC-a)
Glenn L McGrath9a2d2722002-11-10 01:33:55 +000072
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000073LIBIPROUTE-obj:=$(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR)
74
75# We do not need to build an empty non-pic object/archive
76ifneq ($(strip $(LIBIPROUTE-y)),)
77libraries-y+=$(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR)
78endif
79
80# If we are building libbusybox.so _and_ we will use it ourselves then we
81# keep it as small as possible
82ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
83ifneq ($(strip $(LIBIPROUTE-y)),)
84libraries-m+=$(LIBIPROUTE-multi-pic)
85endif
86endif
87
88$(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR): $(patsubst %,$(LIBIPROUTE_DIR)/%,$(LIBIPROUTE-y))
89 $(AR) $(ARFLAGS) $@ $(^)
90
91$(LIBIPROUTE_DIR)/%.o: $(srcdir)/%.c
Eric Andersen7daa0762004-10-08 07:46:08 +000092 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
93