blob: 83e13921e0b93c576a6a4951e672609f3c5989b5 [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
7EDITOR_AR:=editors.a
8ifndef $(EDITOR_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +00009EDITOR_DIR:=$(top_builddir)/editors/
Eric Andersen85208e22002-04-12 12:05:57 +000010endif
Eric Andersen7daa0762004-10-08 07:46:08 +000011srcdir=$(top_srcdir)/editors
Eric Andersen85208e22002-04-12 12:05:57 +000012
13EDITOR-y:=
Glenn L McGrath545106f2002-11-11 06:21:00 +000014EDITOR-$(CONFIG_AWK) += awk.o
Glenn L McGrath655d8142003-06-22 15:32:41 +000015EDITOR-$(CONFIG_PATCH) += patch.o
Eric Andersen85208e22002-04-12 12:05:57 +000016EDITOR-$(CONFIG_SED) += sed.o
17EDITOR-$(CONFIG_VI) += vi.o
Eric Andersen85208e22002-04-12 12:05:57 +000018
19libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
20
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000021EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITOR-y))
22EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c)
23APPLET_SRC-y+=$(EDITOR_SRC-y)
24APPLET_SRC-a+=$(EDITOR_SRC-a)
25
Glenn L McGrath545106f2002-11-11 06:21:00 +000026needlibm-y:=
27needlibm-$(CONFIG_FEATURE_AWK_MATH) := y
28
29ifeq ($(needlibm-y),y)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000030 LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
Glenn L McGrath545106f2002-11-11 06:21:00 +000031endif
32
Eric Andersen85208e22002-04-12 12:05:57 +000033$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
Mike Frysingerb38673f2006-02-02 01:41:53 +000034 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000035
Eric Andersen7daa0762004-10-08 07:46:08 +000036$(EDITOR_DIR)%.o: $(srcdir)/%.c
Mike Frysingerb38673f2006-02-02 01:41:53 +000037 $(compile.c)