blob: 01fb8b52787fad75cab535c56a81e3a83672beb7 [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
18EDITOR_SRC:= $(EDITOR-y)
19EDITOR_OBJ:= $(patsubst %.c,$(EDITOR_DIR)%.o, $(EDITOR_SRC))
20
21libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
22
Glenn L McGrath545106f2002-11-11 06:21:00 +000023needlibm-y:=
24needlibm-$(CONFIG_FEATURE_AWK_MATH) := y
25
26ifeq ($(needlibm-y),y)
27 LIBRARIES += -lm
28endif
29
Eric Andersen85208e22002-04-12 12:05:57 +000030$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
Mike Frysinger4d008962005-07-27 01:09:24 +000031 $(AR) $(ARFLAGS) $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
Eric Andersen85208e22002-04-12 12:05:57 +000032
Eric Andersen7daa0762004-10-08 07:46:08 +000033$(EDITOR_DIR)%.o: $(srcdir)/%.c
34 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
35