blob: 25143c10bdd3b28b81388afe2baf693181e72ce3 [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 +00007MISCUTILS_AR:=miscutils.a
8ifndef $(MISCUTILS_DIR)
9MISCUTILS_DIR:=$(top_builddir)/miscutils/
10endif
11srcdir=$(top_srcdir)/miscutils
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000013MISCUTILS-y:=
Mike Frysinger55e2cf62005-05-11 00:25:47 +000014MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
15MISCUTILS-$(CONFIG_CROND) += crond.o
16MISCUTILS-$(CONFIG_CRONTAB) += crontab.o
Paul Fox79c142d2005-08-01 16:04:40 +000017MISCUTILS-$(CONFIG_BBCONFIG) += bbconfig.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000018MISCUTILS-$(CONFIG_DC) += dc.o
19MISCUTILS-$(CONFIG_DEVFSD) += devfsd.o
20MISCUTILS-$(CONFIG_EJECT) += eject.o
21MISCUTILS-$(CONFIG_HDPARM) += hdparm.o
22MISCUTILS-$(CONFIG_LAST) += last.o
"Vladimir N. Oleynik"4a5d95d2005-09-19 16:18:46 +000023MISCUTILS-${CONFIG_LESS} += less.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000024MISCUTILS-$(CONFIG_MAKEDEVS) += makedevs.o
"Vladimir N. Oleynik"4a5d95d2005-09-19 16:18:46 +000025MISCUTILS-$(CONFIG_MOUNTPOINT) += mountpoint.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000026MISCUTILS-$(CONFIG_MT) += mt.o
Rob Landley0e4690d2006-08-20 22:12:18 +000027MISCUTILS-$(CONFIG_READAHEAD) += readahead.o
Rob Landley51be57e2006-02-23 00:42:25 +000028MISCUTILS-$(CONFIG_RUNLEVEL) += runlevel.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000029MISCUTILS-$(CONFIG_RX) += rx.o
Paul Fox42403642005-08-01 22:52:09 +000030MISCUTILS-$(CONFIG_SETSID) += setsid.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000031MISCUTILS-$(CONFIG_STRINGS) += strings.o
32MISCUTILS-$(CONFIG_TIME) += time.o
33MISCUTILS-$(CONFIG_WATCHDOG) += watchdog.o
Eric Andersen85208e22002-04-12 12:05:57 +000034
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000035ifneq ($(strip $(MISCUTILS-y)),)
36libraries-y+=$(MISCUTILS_DIR)$(MISCUTILS_AR)
Rob Landleyd6e14d82006-02-21 19:11:35 +000037endif
Eric Andersen85208e22002-04-12 12:05:57 +000038
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000039MISCUTILS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(MISCUTILS-y))
40MISCUTILS_SRC-a:=$(wildcard $(srcdir)/*.c)
41APPLET_SRC-y+=$(MISCUTILS_SRC-y)
42APPLET_SRC-a+=$(MISCUTILS_SRC-a)
43
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000044needlibm-y:=
45needlibm-$(CONFIG_DC) := y
Eric Andersen2053a8c2003-10-22 22:29:08 +000046
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000047ifeq ($(needlibm-y),y)
48 LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
49endif
Bernhard Reutner-Fischer07a79e72006-03-09 09:03:37 +000050
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000051$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
52 $(do_ar)
53
54$(MISCUTILS_DIR)%.o: $(srcdir)/%.c
55 $(compile.c)