blob: 2c651d33ba4a399e94f0c5b0723be0ab610c9bb6 [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
7MISCUTILS_AR:=miscutils.a
8ifndef $(MISCUTILS_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +00009MISCUTILS_DIR:=$(top_builddir)/miscutils/
Eric Andersen85208e22002-04-12 12:05:57 +000010endif
Eric Andersen7daa0762004-10-08 07:46:08 +000011srcdir=$(top_srcdir)/miscutils
Eric Andersen85208e22002-04-12 12:05:57 +000012
13MISCUTILS-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
Bernhard Reutner-Fischer62d7acc2005-10-28 20:37:03 +000027MISCUTILS-$(BB_APPLET_RUNLEVEL) += runlevel.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000028MISCUTILS-$(CONFIG_RX) += rx.o
Paul Fox42403642005-08-01 22:52:09 +000029MISCUTILS-$(CONFIG_SETSID) += setsid.o
Mike Frysinger55e2cf62005-05-11 00:25:47 +000030MISCUTILS-$(CONFIG_STRINGS) += strings.o
31MISCUTILS-$(CONFIG_TIME) += time.o
32MISCUTILS-$(CONFIG_WATCHDOG) += watchdog.o
Eric Andersen85208e22002-04-12 12:05:57 +000033
Rob Landleyd6e14d82006-02-21 19:11:35 +000034ifneq ($(strip $(MISCUTILS-y)),)
Eric Andersen85208e22002-04-12 12:05:57 +000035libraries-y+=$(MISCUTILS_DIR)$(MISCUTILS_AR)
Rob Landleyd6e14d82006-02-21 19:11:35 +000036endif
Eric Andersen85208e22002-04-12 12:05:57 +000037
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000038MISCUTILS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(MISCUTILS-y))
39MISCUTILS_SRC-a:=$(wildcard $(srcdir)/*.c)
40APPLET_SRC-y+=$(MISCUTILS_SRC-y)
41APPLET_SRC-a+=$(MISCUTILS_SRC-a)
42
Eric Andersen2053a8c2003-10-22 22:29:08 +000043needlibm-y:=
44needlibm-$(CONFIG_DC) := y
45
46ifeq ($(needlibm-y),y)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000047 LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
Eric Andersen2053a8c2003-10-22 22:29:08 +000048endif
49
Eric Andersen85208e22002-04-12 12:05:57 +000050$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
Mike Frysingerb38673f2006-02-02 01:41:53 +000051 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000052
Eric Andersen7daa0762004-10-08 07:46:08 +000053$(MISCUTILS_DIR)%.o: $(srcdir)/%.c
Mike Frysingerb38673f2006-02-02 01:41:53 +000054 $(compile.c)