Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 4 | # |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 5 | # Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 6 | # |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 7 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 8 | UDHCP_AR:=udhcp.a |
| 9 | ifndef $(UDHCP_DIR) |
| 10 | UDHCP_DIR:=$(top_builddir)/networking/udhcp/ |
| 11 | endif |
| 12 | srcdir=$(top_srcdir)/networking/udhcp |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 13 | |
| 14 | #ok, so I forgot how to do an or, but this is a quick and dirty hack |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 15 | ifeq ($(strip $(CONFIG_UDHCPC)),y) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 16 | CONFIG_UDHCP_SHARED=y |
| 17 | else |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 18 | ifeq ($(strip $(CONFIG_UDHCPD)),y) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 19 | CONFIG_UDHCP_SHARED=y |
| 20 | else |
| 21 | CONFIG_UDHCP_SHARED=n |
| 22 | endif |
| 23 | endif |
| 24 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 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)) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 34 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 35 | ifneq ($(strip $(UDHCP-y)),) |
| 36 | libraries-y+=$(UDHCP_DIR)$(UDHCP_AR) |
| 37 | endif |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 38 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 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) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 43 | |
| 44 | UDHCP_INCLUDES:=$(srcdir) |
| 45 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 46 | APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES) |
| 47 | APPLETS_DEFINE-a+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 48 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 49 | $(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS) |
| 50 | $(do_ar) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 51 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 52 | $(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c |
| 53 | $(compile.c) -DIN_BUSYBOX |