blob: df32247c686422e312d3b211c46886fb0266024b [file] [log] [blame]
Russ Dill61fb4892002-10-14 21:41:28 +00001# Makefile for busybox
2#
Eric Andersenc7bda1c2004-03-15 08:29:22 +00003# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Russ Dill61fb4892002-10-14 21:41:28 +00004#
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +00005# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +00006#
Russ Dill61fb4892002-10-14 21:41:28 +00007
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +00008UDHCP_AR:=udhcp.a
9ifndef $(UDHCP_DIR)
10UDHCP_DIR:=$(top_builddir)/networking/udhcp/
11endif
12srcdir=$(top_srcdir)/networking/udhcp
Russ Dill61fb4892002-10-14 21:41:28 +000013
14#ok, so I forgot how to do an or, but this is a quick and dirty hack
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000015ifeq ($(strip $(CONFIG_UDHCPC)),y)
Russ Dill61fb4892002-10-14 21:41:28 +000016CONFIG_UDHCP_SHARED=y
17else
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000018ifeq ($(strip $(CONFIG_UDHCPD)),y)
Russ Dill61fb4892002-10-14 21:41:28 +000019CONFIG_UDHCP_SHARED=y
20else
21CONFIG_UDHCP_SHARED=n
22endif
23endif
24
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000025UDHCP-y:=
26UDHCP-$(CONFIG_UDHCP_SHARED) += common.c options.c packet.c pidfile.c \
27 signalpipe.c socket.c
28UDHCP-$(CONFIG_UDHCPC) += dhcpc.c clientpacket.c clientsocket.c \
29 script.c
30UDHCP-$(CONFIG_UDHCPD) += dhcpd.c arpping.c files.c leases.c \
31 serverpacket.c static_leases.c
32UDHCP-$(CONFIG_DUMPLEASES) += dumpleases.c
33UDHCP_OBJS:=$(patsubst %.c,$(UDHCP_DIR)%.o, $(UDHCP-y))
Russ Dill61fb4892002-10-14 21:41:28 +000034
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000035ifneq ($(strip $(UDHCP-y)),)
36libraries-y+=$(UDHCP_DIR)$(UDHCP_AR)
37endif
Russ Dill61fb4892002-10-14 21:41:28 +000038
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000039UDHCP-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y))
40UDHCP-a:=$(wildcard $(srcdir)/*.c)
41APPLET_SRC-y+=$(UDHCP-y)
42APPLET_SRC-a+=$(UDHCP-a)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000043
44UDHCP_INCLUDES:=$(srcdir)
45
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000046APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
47APPLETS_DEFINE-a+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000048
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000049$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS)
50 $(do_ar)
Russ Dill61fb4892002-10-14 21:41:28 +000051
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000052$(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c
53 $(compile.c) -DIN_BUSYBOX