make the build system puuuuuuuuuuurty
[platform/upstream/busybox.git] / init / Makefile.in
1 # Makefile for busybox
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4 #
5 # Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7 INIT_AR:=init.a
8 ifndef $(INIT_DIR)
9 INIT_DIR:=$(top_builddir)/init/
10 endif
11 srcdir=$(top_srcdir)/init
12
13 INIT-y:=
14 INIT-$(CONFIG_HALT)                     += halt.o
15 INIT-$(CONFIG_INIT)                     += init.o
16 INIT-$(CONFIG_MESG)                     += mesg.o
17 INIT-$(CONFIG_POWEROFF)                 += poweroff.o
18 INIT-$(CONFIG_REBOOT)                   += reboot.o
19
20 ifeq ($(strip $(CONFIG_HALT)),y)
21 CONFIG_INIT_SHARED=y
22 else
23 ifeq ($(strip $(CONFIG_INIT)),y)
24 CONFIG_INIT_SHARED=y
25 else
26 ifeq ($(strip $(CONFIG_POWEROFF)),y)
27 CONFIG_INIT_SHARED=y
28 else
29 ifeq ($(strip $(CONFIG_REBOOT)),y)
30 CONFIG_INIT_SHARED=y
31 else
32 CONFIG_INIT_SHARED=n
33 endif
34 endif
35 endif
36 endif
37
38 ifeq ($(strip $(CONFIG_INIT_SHARED)),y)
39 INIT-$(CONFIG_INIT_SHARED)        += init_shared.o
40 endif
41
42 libraries-y+=$(INIT_DIR)$(INIT_AR)
43
44 INIT_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(INIT-y))
45 INIT_SRC-a:=$(wildcard $(srcdir)/*.c)
46 APPLET_SRC-y+=$(INIT_SRC-y)
47 APPLET_SRC-a+=$(INIT_SRC-a)
48
49 $(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
50         $(do_ar)
51
52 $(INIT_DIR)%.o: $(srcdir)/%.c
53         $(compile.c)