blob: 805017dcc1198ddafe2d718eee188e5f45e96d5c [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 +00007EDITOR_AR:=editors.a
8ifndef $(EDITOR_DIR)
9EDITOR_DIR:=$(top_builddir)/editors/
10endif
11srcdir=$(top_srcdir)/editors
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000013EDITOR-y:=
14EDITOR-$(CONFIG_AWK) += awk.o
15EDITOR-$(CONFIG_PATCH) += patch.o
16EDITOR-$(CONFIG_SED) += sed.o
17EDITOR-$(CONFIG_VI) += vi.o
18
19ifneq ($(strip $(EDITOR-y)),)
20libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
21endif
22
23EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITOR-y))
24EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c)
25APPLET_SRC-y+=$(EDITOR_SRC-y)
26APPLET_SRC-a+=$(EDITOR_SRC-a)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000027
Glenn L McGrath545106f2002-11-11 06:21:00 +000028needlibm-y:=
29needlibm-$(CONFIG_FEATURE_AWK_MATH) := y
30
31ifeq ($(needlibm-y),y)
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000032 LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
Glenn L McGrath545106f2002-11-11 06:21:00 +000033endif
34
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000035$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
36 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000037
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000038$(EDITOR_DIR)%.o: $(srcdir)/%.c
39 $(compile.c)