114d6200d092d40d9083fac2893e4079e2cb227a
[platform/upstream/busybox.git] / editors / Makefile.in
1 # Makefile for busybox
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4 #
5 # Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7 EDITOR_AR:=editors.a
8 ifndef $(EDITOR_DIR)
9 EDITOR_DIR:=$(top_builddir)/editors/
10 endif
11 srcdir=$(top_srcdir)/editors
12
13 EDITOR-y:=
14 EDITOR-$(CONFIG_AWK)       += awk.o
15 EDITOR-$(CONFIG_PATCH)     += patch.o
16 EDITOR-$(CONFIG_SED)       += sed.o
17 EDITOR-$(CONFIG_VI)        += vi.o
18
19 libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
20
21 EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITOR-y))
22 EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c)
23 APPLET_SRC-y+=$(EDITOR_SRC-y)
24 APPLET_SRC-a+=$(EDITOR_SRC-a)
25
26 needlibm-y:=
27 needlibm-$(CONFIG_FEATURE_AWK_MATH) := y
28
29 ifeq ($(needlibm-y),y)
30   LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES))
31 endif
32
33 $(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
34         $(AR) $(ARFLAGS) $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
35
36 $(EDITOR_DIR)%.o: $(srcdir)/%.c
37         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
38