blob: a48ead446be5af5bc3b1270cc8c265f45908bc69 [file] [log] [blame]
Eric Andersen85208e22002-04-12 12:05:57 +00001# Makefile for busybox
2#
Mike Frysinger0d4ee682005-09-24 06:01:57 +00003# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
Eric Andersen85208e22002-04-12 12:05:57 +00004#
Mike Frysinger0d4ee682005-09-24 06:01:57 +00005# Licensed under the GPL v2, see the file LICENSE in this tarball.
Eric Andersen85208e22002-04-12 12:05:57 +00006
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +00007INIT_AR:=init.a
8ifndef $(INIT_DIR)
9INIT_DIR:=$(top_builddir)/init/
10endif
11srcdir=$(top_srcdir)/init
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000013INIT-y:=
Eric Andersen85208e22002-04-12 12:05:57 +000014INIT-$(CONFIG_HALT) += halt.o
15INIT-$(CONFIG_INIT) += init.o
Glenn L McGrath061c9002002-09-16 04:21:46 +000016INIT-$(CONFIG_MESG) += mesg.o
Eric Andersen85208e22002-04-12 12:05:57 +000017
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000018ifeq ($(strip $(CONFIG_HALT)),y)
Eric Andersenb01ed652003-06-27 17:08:15 +000019CONFIG_INIT_SHARED=y
20else
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000021ifeq ($(strip $(CONFIG_INIT)),y)
Eric Andersenb01ed652003-06-27 17:08:15 +000022CONFIG_INIT_SHARED=y
23else
Eric Andersenb01ed652003-06-27 17:08:15 +000024CONFIG_INIT_SHARED=n
25endif
26endif
Eric Andersenb01ed652003-06-27 17:08:15 +000027
Eric Andersenb01ed652003-06-27 17:08:15 +000028INIT-$(CONFIG_INIT_SHARED) += init_shared.o
Eric Andersenb01ed652003-06-27 17:08:15 +000029
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000030ifneq ($(strip $(INIT-y)),)
31libraries-y+=$(INIT_DIR)$(INIT_AR)
32endif
33
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000034INIT_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(INIT-y))
35INIT_SRC-a:=$(wildcard $(srcdir)/*.c)
36APPLET_SRC-y+=$(INIT_SRC-y)
37APPLET_SRC-a+=$(INIT_SRC-a)
38
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000039$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
40 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000041
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000042$(INIT_DIR)%.o: $(srcdir)/%.c
43 $(compile.c)