Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 1 | # 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 | |
| 8 | UDHCP_AR:=udhcp.a |
| 9 | ifndef $(UDHCP_DIR) |
| 10 | UDHCP_DIR:=$(top_builddir)/networking/udhcp/ |
| 11 | endif |
| 12 | srcdir=$(top_srcdir)/networking/udhcp |
| 13 | |
| 14 | #ok, so I forgot how to do an or, but this is a quick and dirty hack |
| 15 | ifeq ($(strip $(CONFIG_UDHCPC)),y) |
| 16 | CONFIG_UDHCP_SHARED=y |
| 17 | else |
| 18 | ifeq ($(strip $(CONFIG_UDHCPD)),y) |
| 19 | CONFIG_UDHCP_SHARED=y |
| 20 | else |
| 21 | CONFIG_UDHCP_SHARED=n |
| 22 | endif |
| 23 | endif |
| 24 | |
| 25 | UDHCP-y:= |
| 26 | UDHCP-$(CONFIG_UDHCP_SHARED) += common.c options.c packet.c pidfile.c \ |
| 27 | signalpipe.c socket.c |
| 28 | UDHCP-$(CONFIG_UDHCPC) += dhcpc.c clientpacket.c clientsocket.c \ |
| 29 | script.c |
| 30 | UDHCP-$(CONFIG_UDHCPD) += dhcpd.c arpping.c files.c leases.c \ |
| 31 | serverpacket.c static_leases.c |
| 32 | UDHCP-$(CONFIG_DUMPLEASES) += dumpleases.c |
| 33 | UDHCP_OBJS:=$(patsubst %.c,$(UDHCP_DIR)%.o, $(UDHCP-y)) |
| 34 | |
| 35 | ifneq ($(strip $(UDHCP-y)),) |
| 36 | libraries-y+=$(UDHCP_DIR)$(UDHCP_AR) |
| 37 | endif |
| 38 | |
| 39 | UDHCP-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y)) |
| 40 | UDHCP-a:=$(wildcard $(srcdir)/*.c) |
| 41 | APPLET_SRC-y+=$(UDHCP-y) |
| 42 | APPLET_SRC-a+=$(UDHCP-a) |
| 43 | |
| 44 | UDHCP_INCLUDES:=$(srcdir) |
| 45 | |
| 46 | APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES) |
| 47 | APPLETS_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 |