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 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 7 | srcdir=$(top_srcdir)/networking/udhcp |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 8 | objdir=$(top_builddir)/networking/udhcp |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 9 | |
| 10 | #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] | 11 | ifeq ($(strip $(CONFIG_UDHCPC)),y) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 12 | CONFIG_UDHCP_SHARED=y |
| 13 | else |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 14 | ifeq ($(strip $(CONFIG_UDHCPD)),y) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 15 | CONFIG_UDHCP_SHARED=y |
| 16 | else |
| 17 | CONFIG_UDHCP_SHARED=n |
| 18 | endif |
| 19 | endif |
| 20 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 21 | UDHCP__SHARED_FILES:=common.c options.c packet.c pidfile.c signalpipe.c socket.c |
| 22 | UDHCP__UDHCPC_FILES:=dhcpc.c clientpacket.c clientsocket.c script.c |
| 23 | UDHCP__UDHCPD_FILES:=dhcpd.c arpping.c files.c leases.c serverpacket.c \ |
| 24 | static_leases.c |
| 25 | UDHCP__DUMPLEASES_FILES:=dumpleases.c |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 26 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 27 | UDHCP-$(CONFIG_UDHCP_SHARED) += $(UDHCP__SHARED_FILES) |
| 28 | UDHCP-$(CONFIG_UDHCPC) += $(UDHCP__UDHCPC_FILES) |
| 29 | UDHCP-$(CONFIG_UDHCPD) += $(UDHCP__UDHCPD_FILES) |
| 30 | UDHCP-$(CONFIG_DUMPLEASES) += $(UDHCP__DUMPLEASES_FILES) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 31 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 32 | UDHCP_SRC-y:=$(patsubst %,$(srcdir)/%,$(UDHCP-y)) |
| 33 | UDHCP_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 34 | APPLET_SRC-y+=$(UDHCP_SRC-y) |
| 35 | APPLET_SRC-a+=$(UDHCP_SRC-a) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 36 | |
| 37 | UDHCP_INCLUDES:=$(srcdir) |
| 38 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 39 | #APPLETS_DEFINE-y+= -I$(UDHCP_INCLUDES) -DIN_BUSYBOX |
| 40 | #APPLETS_DEFINE-a+= -I$(UDHCP_INCLUDES) -DIN_BUSYBOX |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 41 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 42 | CFLAGS-udhcp:= -I$(UDHCP_INCLUDES) |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 43 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 44 | # bug in make-3.80 prevents this: |
| 45 | #define udhcp__flags |
| 46 | #CFLAGS-udhcp-$(1):=-DIN_BUSYBOX |
| 47 | #endef |
| 48 | # |
| 49 | #ifeq ($(CONFIG_UDHCP_SHARED),y) |
| 50 | #$(foreach f,$(UDHCP__SHARED_FILES),$(eval $(call udhcp__flags,$(f)))) |
| 51 | #endif |
| 52 | #ifeq ($(CONFIG_UDHCPC),y) |
| 53 | #$(foreach f,$(UDHCP__UDHCPC_FILES),$(eval $(call udhcp__flags,$(f)))) |
| 54 | #endif |
| 55 | #ifeq ($(CONFIG_UDHCPD),y) |
| 56 | #$(foreach f,$(UDHCP__UDHCPD_FILES),$(eval $(call udhcp__flags,$(f)))) |
| 57 | #endif |
| 58 | #ifeq ($(CONFIG_DUMPLEASES),y) |
| 59 | #$(foreach f,$(UDHCP__DUMPLEASES_FILES),$(eval $(call udhcp__flags,$(f)))) |
| 60 | #endif |
| 61 | |
| 62 | ifeq ($(CONFIG_UDHCP_SHARED),y) |
| 63 | CFLAGS-udhcp-common.c:=-DIN_BUSYBOX |
| 64 | CFLAGS-udhcp-options.c:=-DIN_BUSYBOX |
| 65 | CFLAGS-udhcp-packet.c:=-DIN_BUSYBOX |
| 66 | CFLAGS-udhcp-pidfile.c:=-DIN_BUSYBOX |
| 67 | CFLAGS-udhcp-signalpipe.c:=-DIN_BUSYBOX |
| 68 | CFLAGS-udhcp-socket.c:=-DIN_BUSYBOX |
| 69 | endif |
| 70 | ifeq ($(CONFIG_UDHCPC),y) |
| 71 | CFLAGS-udhcp-dhcpc.c:=-DIN_BUSYBOX |
| 72 | CFLAGS-udhcp-clientpacket.c:=-DIN_BUSYBOX |
| 73 | CFLAGS-udhcp-clientsocket.c:=-DIN_BUSYBOX |
| 74 | CFLAGS-udhcp-script.c:=-DIN_BUSYBOX |
| 75 | endif |
| 76 | ifeq ($(CONFIG_UDHCPD),y) |
| 77 | CFLAGS-udhcp-dhcpd.c:=-DIN_BUSYBOX |
| 78 | CFLAGS-udhcp-arpping.c:=-DIN_BUSYBOX |
| 79 | CFLAGS-udhcp-files.c:=-DIN_BUSYBOX |
| 80 | CFLAGS-udhcp-leases.c:=-DIN_BUSYBOX |
| 81 | CFLAGS-udhcp-serverpacket.c:=-DIN_BUSYBOX |
| 82 | CFLAGS-udhcp-static_leases.c:=-DIN_BUSYBOX |
| 83 | endif |
| 84 | ifeq ($(CONFIG_DUMPLEASES),y) |
| 85 | CFLAGS-udhcp-dumpleases.c:=-DIN_BUSYBOX |
| 86 | endif |
| 87 | |
| 88 | |
| 89 | networking_udhcp_OBJ:=$(patsubst %.c,$(objdir)/%.o,$(UDHCP-y)) |
| 90 | |