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 | MODUTILS_AR:=modutils.a |
| 8 | ifndef $(MODUTILS_DIR) |
| 9 | MODUTILS_DIR:=$(top_builddir)/modutils/ |
| 10 | endif |
| 11 | srcdir=$(top_srcdir)/modutils |
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 | MODUTILS-y:= |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 14 | MODUTILS-$(CONFIG_INSMOD) += insmod.o |
| 15 | MODUTILS-$(CONFIG_LSMOD) += lsmod.o |
| 16 | MODUTILS-$(CONFIG_MODPROBE) += modprobe.o |
| 17 | MODUTILS-$(CONFIG_RMMOD) += rmmod.o |
| 18 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 19 | ifneq ($(strip $(MODUTILS-y)),) |
| 20 | libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR) |
| 21 | endif |
| 22 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 23 | MODUTILS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(MODUTILS-y)) |
| 24 | MODUTILS_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 25 | APPLET_SRC-y+=$(MODUTILS_SRC-y) |
| 26 | APPLET_SRC-a+=$(MODUTILS_SRC-a) |
| 27 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 28 | $(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y)) |
| 29 | $(do_ar) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 30 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 31 | $(MODUTILS_DIR)%.o: $(srcdir)/%.c |
| 32 | $(compile.c) |