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 | |
| 7 | INIT_AR:=init.a |
| 8 | ifndef $(INIT_DIR) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 9 | INIT_DIR:=$(top_builddir)/init/ |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 10 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 11 | srcdir=$(top_srcdir)/init |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 12 | |
| 13 | INIT-y:= |
| 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 | INIT-$(CONFIG_POWEROFF) += poweroff.o |
| 18 | INIT-$(CONFIG_REBOOT) += reboot.o |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 19 | |
Eric Andersen | b01ed65 | 2003-06-27 17:08:15 +0000 | [diff] [blame] | 20 | ifeq ($(CONFIG_HALT), y) |
| 21 | CONFIG_INIT_SHARED=y |
| 22 | else |
| 23 | ifeq ($(CONFIG_INIT), y) |
| 24 | CONFIG_INIT_SHARED=y |
| 25 | else |
| 26 | ifeq ($(CONFIG_POWEROFF), y) |
| 27 | CONFIG_INIT_SHARED=y |
| 28 | else |
| 29 | ifeq ($(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 ($(CONFIG_INIT_SHARED), y) |
| 39 | INIT-$(CONFIG_INIT_SHARED) += init_shared.o |
| 40 | endif |
| 41 | |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 42 | libraries-y+=$(INIT_DIR)$(INIT_AR) |
| 43 | |
| 44 | $(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y)) |
Mike Frysinger | 4d00896 | 2005-07-27 01:09:24 +0000 | [diff] [blame] | 45 | $(AR) $(ARFLAGS) $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y)) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 46 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 47 | $(INIT_DIR)%.o: $(srcdir)/%.c |
| 48 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 49 | |