2002-10-15 03:11:28 +05:30
|
|
|
# Makefile for busybox
|
|
|
|
#
|
2004-03-15 13:59:22 +05:30
|
|
|
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
2002-10-15 03:11:28 +05:30
|
|
|
#
|
2006-01-15 19:34:57 +05:30
|
|
|
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
|
2002-10-15 03:11:28 +05:30
|
|
|
|
2006-03-09 14:33:37 +05:30
|
|
|
srcdir:=$(top_srcdir)/networking/udhcp
|
|
|
|
objdir:=$(top_builddir)/networking/udhcp
|
2002-10-15 03:11:28 +05:30
|
|
|
|
|
|
|
#ok, so I forgot how to do an or, but this is a quick and dirty hack
|
2006-01-15 19:34:57 +05:30
|
|
|
ifeq ($(strip $(CONFIG_UDHCPC)),y)
|
2002-10-15 03:11:28 +05:30
|
|
|
CONFIG_UDHCP_SHARED=y
|
|
|
|
else
|
2006-01-15 19:34:57 +05:30
|
|
|
ifeq ($(strip $(CONFIG_UDHCPD)),y)
|
2002-10-15 03:11:28 +05:30
|
|
|
CONFIG_UDHCP_SHARED=y
|
|
|
|
else
|
|
|
|
CONFIG_UDHCP_SHARED=n
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
UDHCP__SHARED_FILES:=common.c options.c packet.c pidfile.c signalpipe.c socket.c
|
|
|
|
UDHCP__UDHCPC_FILES:=dhcpc.c clientpacket.c clientsocket.c script.c
|
|
|
|
UDHCP__UDHCPD_FILES:=dhcpd.c arpping.c files.c leases.c serverpacket.c \
|
|
|
|
static_leases.c
|
|
|
|
UDHCP__DUMPLEASES_FILES:=dumpleases.c
|
|
|
|
|
|
|
|
UDHCP-$(CONFIG_UDHCP_SHARED) += $(UDHCP__SHARED_FILES)
|
|
|
|
UDHCP-$(CONFIG_UDHCPC) += $(UDHCP__UDHCPC_FILES)
|
|
|
|
UDHCP-$(CONFIG_UDHCPD) += $(UDHCP__UDHCPD_FILES)
|
|
|
|
UDHCP-$(CONFIG_DUMPLEASES) += $(UDHCP__DUMPLEASES_FILES)
|
2002-10-15 03:11:28 +05:30
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
UDHCP_SRC-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y))
|
|
|
|
UDHCP_SRC-a:=$(wildcard $(srcdir)/*.c)
|
|
|
|
APPLET_SRC-y+=$(UDHCP_SRC-y)
|
|
|
|
APPLET_SRC-a+=$(UDHCP_SRC-a)
|
2006-01-15 19:34:57 +05:30
|
|
|
|
|
|
|
UDHCP_INCLUDES:=$(srcdir)
|
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
#APPLETS_DEFINE-y+= -I$(UDHCP_INCLUDES) -DIN_BUSYBOX
|
|
|
|
#APPLETS_DEFINE-a+= -I$(UDHCP_INCLUDES) -DIN_BUSYBOX
|
|
|
|
|
|
|
|
CFLAGS-udhcp:= -I$(UDHCP_INCLUDES)
|
|
|
|
|
|
|
|
# bug in make-3.80 prevents this:
|
|
|
|
#define udhcp__flags
|
|
|
|
#CFLAGS-udhcp-$(1):=-DIN_BUSYBOX
|
|
|
|
#endef
|
|
|
|
#
|
|
|
|
#ifeq ($(CONFIG_UDHCP_SHARED),y)
|
|
|
|
#$(foreach f,$(UDHCP__SHARED_FILES),$(eval $(call udhcp__flags,$(f))))
|
|
|
|
#endif
|
|
|
|
#ifeq ($(CONFIG_UDHCPC),y)
|
|
|
|
#$(foreach f,$(UDHCP__UDHCPC_FILES),$(eval $(call udhcp__flags,$(f))))
|
|
|
|
#endif
|
|
|
|
#ifeq ($(CONFIG_UDHCPD),y)
|
|
|
|
#$(foreach f,$(UDHCP__UDHCPD_FILES),$(eval $(call udhcp__flags,$(f))))
|
|
|
|
#endif
|
|
|
|
#ifeq ($(CONFIG_DUMPLEASES),y)
|
|
|
|
#$(foreach f,$(UDHCP__DUMPLEASES_FILES),$(eval $(call udhcp__flags,$(f))))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_UDHCP_SHARED),y)
|
|
|
|
CFLAGS-udhcp-common.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-options.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-packet.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-pidfile.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-signalpipe.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-socket.c:=-DIN_BUSYBOX
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_UDHCPC),y)
|
|
|
|
CFLAGS-udhcp-dhcpc.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-clientpacket.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-clientsocket.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-script.c:=-DIN_BUSYBOX
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_UDHCPD),y)
|
|
|
|
CFLAGS-udhcp-dhcpd.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-arpping.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-files.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-leases.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-serverpacket.c:=-DIN_BUSYBOX
|
|
|
|
CFLAGS-udhcp-static_leases.c:=-DIN_BUSYBOX
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_DUMPLEASES),y)
|
|
|
|
CFLAGS-udhcp-dumpleases.c:=-DIN_BUSYBOX
|
|
|
|
endif
|
|
|
|
|
2006-01-15 19:34:57 +05:30
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
networking_udhcp_OBJ:=$(patsubst %.c,$(objdir)/%.o,$(UDHCP-y))
|
2002-12-07 03:12:56 +05:30
|
|
|
|
2006-03-09 14:33:37 +05:30
|
|
|
$(networking_udhcp_OBJ): $(objdir)/%.o: $(srcdir)/%.c
|
|
|
|
$(objdir)/udhcp.a: $(networking_udhcp_OBJ)
|
|
|
|
libraries-y:=$(libraries-y) $(objdir)/udhcp.a
|
|
|
|
|