blob: 77c4b720a9080bddebd217b0f1a853d38a3a22bd [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
Rob Landley67d49432006-06-22 18:48:34 +000015ifeq ($(strip $(CONFIG_APP_UDHCPC)),y)
Mike Frysinger7031f622006-05-08 03:20:50 +000016CONFIG_UDHCP_SHARED=y
17else
Rob Landley67d49432006-06-22 18:48:34 +000018ifeq ($(strip $(CONFIG_APP_UDHCPD)),y)
Mike Frysinger7031f622006-05-08 03:20:50 +000019CONFIG_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
Rob Landley67d49432006-06-22 18:48:34 +000028UDHCP-$(CONFIG_APP_UDHCPC) += dhcpc.c clientpacket.c clientsocket.c \
Mike Frysinger7031f622006-05-08 03:20:50 +000029 script.c
Rob Landley67d49432006-06-22 18:48:34 +000030UDHCP-$(CONFIG_APP_UDHCPD) += dhcpd.c arpping.c files.c leases.c \
Mike Frysinger7031f622006-05-08 03:20:50 +000031 serverpacket.c static_leases.c
Rob Landley67d49432006-06-22 18:48:34 +000032UDHCP-$(CONFIG_APP_DUMPLEASES) += dumpleases.c
Mike Frysinger7031f622006-05-08 03:20:50 +000033UDHCP_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