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. |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | UDHCP_AR:=udhcp.a |
| 9 | ifndef $(UDHCP_DIR) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 10 | UDHCP_DIR:=$(top_builddir)/networking/udhcp/ |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 11 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 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 | |
| 25 | UDHCP-y:= |
Russ Dill | 4e864a3 | 2003-12-18 22:25:38 +0000 | [diff] [blame] | 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 \ |
Eric Andersen | abf58d6 | 2004-10-08 08:49:26 +0000 | [diff] [blame] | 31 | serverpacket.c static_leases.c |
Eric Andersen | 1f1c3f9 | 2002-12-11 22:45:33 +0000 | [diff] [blame] | 32 | UDHCP-$(CONFIG_DUMPLEASES) += dumpleases.c |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 33 | UDHCP_OBJS:=$(patsubst %.c,$(UDHCP_DIR)%.o, $(UDHCP-y)) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 34 | |
| 35 | libraries-y+=$(UDHCP_DIR)$(UDHCP_AR) |
| 36 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 37 | UDHCP-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y)) |
| 38 | UDHCP-a:=$(wildcard $(srcdir)/*.c) |
| 39 | APPLET_SRC-y+=$(UDHCP-y) |
| 40 | APPLET_SRC-a+=$(UDHCP-a) |
| 41 | |
| 42 | UDHCP_INCLUDES:=$(srcdir) |
| 43 | |
| 44 | APPLETS_DEFINE-y+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES) |
| 45 | APPLETS_DEFINE-a+=-DIN_BUSYBOX -I$(UDHCP_INCLUDES) |
| 46 | |
Eric Andersen | 1f1c3f9 | 2002-12-11 22:45:33 +0000 | [diff] [blame] | 47 | $(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS) |
Mike Frysinger | 4d00896 | 2005-07-27 01:09:24 +0000 | [diff] [blame] | 48 | $(AR) $(ARFLAGS) $@ $(UDHCP_OBJS) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 49 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 50 | $(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c |
Russ Dill | 6b3f757 | 2003-12-16 02:38:09 +0000 | [diff] [blame] | 51 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DIN_BUSYBOX -c $< -o $@ |
Eric Andersen | b2bfd34 | 2002-12-11 22:59:39 +0000 | [diff] [blame] | 52 | |