blob: 9a46e32c2a04781229a2d4d1f9995f6f79f4237b [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:=
Rob Landley3b890392006-05-04 20:56:43 +000014EDITOR-$(CONFIG_AWK) += awk.o
15EDITOR-$(CONFIG_ED) += ed.o
16EDITOR-$(CONFIG_PATCH) += patch.o
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000017EDITOR-$(CONFIG_SED) += sed.o
18EDITOR-$(CONFIG_VI) += vi.o
19
20ifneq ($(strip $(EDITOR-y)),)
21libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
22endif
23
24EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITOR-y))
25EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c)
26APPLET_SRC-y+=$(EDITOR_SRC-y)
27APPLET_SRC-a+=$(EDITOR_SRC-a)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000028
Glenn L McGrath545106f2002-11-11 06:21:00 +000029needlibm-y:=
30needlibm-$(CONFIG_FEATURE_AWK_MATH) := y
31
32ifeq ($(needlibm-y),y)
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000033 LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
Glenn L McGrath545106f2002-11-11 06:21:00 +000034endif
35
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000036$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
37 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000038
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000039$(EDITOR_DIR)%.o: $(srcdir)/%.c
40 $(compile.c)