Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 4 | # |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 5 | # Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | LIBIPROUTE_AR:=libiproute.a |
| 9 | ifndef $(LIBIPROUTE_DIR) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 10 | LIBIPROUTE_DIR:=$(top_builddir)/networking/libiproute |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 11 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 12 | srcdir=$(top_srcdir)/networking/libiproute |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 13 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 14 | LIBIPROUTE-y:= |
Glenn L McGrath | 8ae7501 | 2002-11-10 10:20:45 +0000 | [diff] [blame] | 15 | LIBIPROUTE-$(CONFIG_IP) += \ |
Glenn L McGrath | f112daa | 2002-12-01 23:04:06 +0000 | [diff] [blame] | 16 | ip_parse_common_args.o \ |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 17 | 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 McGrath | 36c7478 | 2004-04-12 02:22:39 +0000 | [diff] [blame] | 30 | LIBIPROUTE-$(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 | |
| 40 | LIBIPROUTE-$(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 | |
| 51 | LIBIPROUTE-$(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 | |
| 60 | LIBIPROUTE-$(CONFIG_IPTUNNEL) += \ |
| 61 | ip_parse_common_args.o \ |
| 62 | iptunnel.o \ |
| 63 | rt_names.o \ |
| 64 | utils.o |
| 65 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 66 | LIBIPROUTE-y:=$(sort $(LIBIPROUTE-y)) |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 67 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 68 | LIBIPROUTE_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBIPROUTE-y))) |
| 69 | LIBIPROUTE_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 70 | LIBRARY_SRC-y+=$(LIBIPROUTE_SRC-y) |
| 71 | LIBRARY_SRC-a+=$(LIBIPROUTE_SRC-a) |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 72 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 73 | LIBIPROUTE-obj:=$(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR) |
| 74 | |
| 75 | # We do not need to build an empty non-pic object/archive |
| 76 | ifneq ($(strip $(LIBIPROUTE-y)),) |
| 77 | libraries-y+=$(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR) |
| 78 | endif |
| 79 | |
| 80 | # If we are building libbusybox.so _and_ we will use it ourselves then we |
| 81 | # keep it as small as possible |
| 82 | ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) |
| 83 | ifneq ($(strip $(LIBIPROUTE-y)),) |
| 84 | libraries-m+=$(LIBIPROUTE-multi-pic) |
| 85 | endif |
| 86 | endif |
| 87 | |
| 88 | $(LIBIPROUTE_DIR)/$(LIBIPROUTE_AR): $(patsubst %,$(LIBIPROUTE_DIR)/%,$(LIBIPROUTE-y)) |
| 89 | $(AR) $(ARFLAGS) $@ $(^) |
| 90 | |
| 91 | $(LIBIPROUTE_DIR)/%.o: $(srcdir)/%.c |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 92 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 93 | |