Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Mike Frysinger | 0d4ee68 | 2005-09-24 06:01:57 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 4 | # |
Mike Frysinger | 0d4ee68 | 2005-09-24 06:01:57 +0000 | [diff] [blame] | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 6 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 7 | INIT_AR:=init.a |
| 8 | ifndef $(INIT_DIR) |
| 9 | INIT_DIR:=$(top_builddir)/init/ |
| 10 | endif |
| 11 | srcdir=$(top_srcdir)/init |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 12 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 13 | INIT-y:= |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 14 | INIT-$(CONFIG_HALT) += halt.o |
| 15 | INIT-$(CONFIG_INIT) += init.o |
Glenn L McGrath | 061c900 | 2002-09-16 04:21:46 +0000 | [diff] [blame] | 16 | INIT-$(CONFIG_MESG) += mesg.o |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 17 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 18 | ifeq ($(strip $(CONFIG_HALT)),y) |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 19 | CONFIG_INIT_SHARED=y |
| 20 | else |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 21 | ifeq ($(strip $(CONFIG_INIT)),y) |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 22 | CONFIG_INIT_SHARED=y |
| 23 | else |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 24 | CONFIG_INIT_SHARED=n |
| 25 | endif |
| 26 | endif |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 27 | |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 28 | INIT-$(CONFIG_INIT_SHARED) += init_shared.o |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 29 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 30 | ifneq ($(strip $(INIT-y)),) |
| 31 | libraries-y+=$(INIT_DIR)$(INIT_AR) |
| 32 | endif |
| 33 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 34 | INIT_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(INIT-y)) |
| 35 | INIT_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 36 | APPLET_SRC-y+=$(INIT_SRC-y) |
| 37 | APPLET_SRC-a+=$(INIT_SRC-a) |
| 38 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 39 | $(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y)) |
| 40 | $(do_ar) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 41 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 42 | $(INIT_DIR)%.o: $(srcdir)/%.c |
| 43 | $(compile.c) |