blob: df32247c686422e312d3b211c46886fb0266024b [file] [log] [blame]
Mike Frysinger7031f622006-05-08 03:20:50 +00001# Makefile for busybox
2#
3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6#
7
8UDHCP_AR:=udhcp.a
9ifndef $(UDHCP_DIR)
10UDHCP_DIR:=$(top_builddir)/networking/udhcp/
11endif
12srcdir=$(top_srcdir)/networking/udhcp
13
14#ok, so I forgot how to do an or, but this is a quick and dirty hack
15ifeq ($(strip $(CONFIG_UDHCPC)),y)
16CONFIG_UDHCP_SHARED=y
17else
18ifeq ($(strip $(CONFIG_UDHCPD)),y)
19CONFIG_UDHCP_SHARED=y
20else
21CONFIG_UDHCP_SHARED=n
22endif
23endif
24
25UDHCP-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))
34
35ifneq ($(strip $(UDHCP-y)),)
36libraries-y+=$(UDHCP_DIR)$(UDHCP_AR)
37endif
38
39UDHCP-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y))
40UDHCP-a:=$(wildcard $(srcdir)/*.c)
41APPLET_SRC-y+=$(UDHCP-y)
42APPLET_SRC-a+=$(UDHCP-a)
43
44UDHCP_INCLUDES:=$(srcdir)
45
46APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
47APPLETS_DEFINE-a+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
48
49$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS)
50 $(do_ar)
51
52$(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c
53 $(compile.c) -DIN_BUSYBOX