import lsattr and chattr from e2fsprogs
[oweals/busybox.git] / init / Makefile.in
index cd3ead839d1ce6767de648d013ea47bf37ce9cde..807259dee1a4883a10be7323e019390de0bb3f9a 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,8 +19,9 @@
 
 INIT_AR:=init.a
 ifndef $(INIT_DIR)
-INIT_DIR:=$(TOPDIR)init/
+INIT_DIR:=$(top_builddir)/init/
 endif
+srcdir=$(top_srcdir)/init
 
 INIT-y:=
 INIT-$(CONFIG_HALT)                    += halt.o
@@ -28,11 +29,34 @@ INIT-$(CONFIG_INIT)                 += init.o
 INIT-$(CONFIG_MESG)                    += mesg.o
 INIT-$(CONFIG_POWEROFF)                        += poweroff.o
 INIT-$(CONFIG_REBOOT)                  += reboot.o
-INIT-$(CONFIG_START_STOP_DAEMON)       += start_stop_daemon.o
-INIT-$(CONFIG_RUN_PARTS)               += run_parts.o
+
+ifeq ($(CONFIG_HALT), y)
+CONFIG_INIT_SHARED=y
+else
+ifeq ($(CONFIG_INIT), y)
+CONFIG_INIT_SHARED=y
+else
+ifeq ($(CONFIG_POWEROFF), y)
+CONFIG_INIT_SHARED=y
+else
+ifeq ($(CONFIG_REBOOT), y)
+CONFIG_INIT_SHARED=y
+else
+CONFIG_INIT_SHARED=n
+endif
+endif
+endif
+endif
+
+ifeq ($(CONFIG_INIT_SHARED), y)
+INIT-$(CONFIG_INIT_SHARED)        += init_shared.o
+endif
 
 libraries-y+=$(INIT_DIR)$(INIT_AR)
 
 $(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
        $(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
 
+$(INIT_DIR)%.o: $(srcdir)/%.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+