blob: 8573a2fc4ed321c7aec2eb18013020faa5969e4b [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.
Russ Dill61fb4892002-10-14 21:41:28 +00006#
7
8UDHCP_AR:=udhcp.a
9ifndef $(UDHCP_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +000010UDHCP_DIR:=$(top_builddir)/networking/udhcp/
Russ Dill61fb4892002-10-14 21:41:28 +000011endif
Eric Andersen7daa0762004-10-08 07:46:08 +000012srcdir=$(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
25UDHCP-y:=
Russ Dill4e864a32003-12-18 22:25:38 +000026UDHCP-$(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 \
Eric Andersenabf58d62004-10-08 08:49:26 +000031 serverpacket.c static_leases.c
Eric Andersen1f1c3f92002-12-11 22:45:33 +000032UDHCP-$(CONFIG_DUMPLEASES) += dumpleases.c
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000033UDHCP_OBJS:=$(patsubst %.c,$(UDHCP_DIR)%.o, $(UDHCP-y))
Russ Dill61fb4892002-10-14 21:41:28 +000034
35libraries-y+=$(UDHCP_DIR)$(UDHCP_AR)
36
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000037UDHCP-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y))
38UDHCP-a:=$(wildcard $(srcdir)/*.c)
39APPLET_SRC-y+=$(UDHCP-y)
40APPLET_SRC-a+=$(UDHCP-a)
41
42UDHCP_INCLUDES:=$(srcdir)
43
44APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
45APPLETS_DEFINE-a+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES)
46
Eric Andersen1f1c3f92002-12-11 22:45:33 +000047$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS)
Mike Frysinger4d008962005-07-27 01:09:24 +000048 $(AR) $(ARFLAGS) $@ $(UDHCP_OBJS)
Russ Dill61fb4892002-10-14 21:41:28 +000049
Eric Andersen7daa0762004-10-08 07:46:08 +000050$(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c
Russ Dill6b3f7572003-12-16 02:38:09 +000051 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DIN_BUSYBOX -c $< -o $@
Eric Andersenb2bfd342002-12-11 22:59:39 +000052