diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/Makefile.in | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/editors/Makefile.in b/editors/Makefile.in index dd09e7a21..805017dcc 100644 --- a/editors/Makefile.in +++ b/editors/Makefile.in | |||
@@ -4,29 +4,36 @@ | |||
4 | # | 4 | # |
5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
6 | 6 | ||
7 | srcdir:=$(top_srcdir)/editors | 7 | EDITOR_AR:=editors.a |
8 | objdir:=$(top_builddir)/editors | 8 | ifndef $(EDITOR_DIR) |
9 | EDITOR_DIR:=$(top_builddir)/editors/ | ||
10 | endif | ||
11 | srcdir=$(top_srcdir)/editors | ||
9 | 12 | ||
10 | EDITORS-$(CONFIG_AWK) += awk.o | 13 | EDITOR-y:= |
11 | EDITORS-$(CONFIG_PATCH) += patch.o | 14 | EDITOR-$(CONFIG_AWK) += awk.o |
12 | EDITORS-$(CONFIG_SED) += sed.o | 15 | EDITOR-$(CONFIG_PATCH) += patch.o |
13 | EDITORS-$(CONFIG_VI) += vi.o | 16 | EDITOR-$(CONFIG_SED) += sed.o |
17 | EDITOR-$(CONFIG_VI) += vi.o | ||
14 | 18 | ||
15 | needlibm-y:= | 19 | ifneq ($(strip $(EDITOR-y)),) |
16 | needlibm-$(CONFIG_FEATURE_AWK_MATH) := y | 20 | libraries-y+=$(EDITOR_DIR)$(EDITOR_AR) |
17 | |||
18 | ifeq ($(needlibm-y),y) | ||
19 | LIBRARIES := $(filter-out -lm,$(LIBRARIES)) -lm | ||
20 | endif | 21 | endif |
21 | 22 | ||
22 | EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITORS-y)) | 23 | EDITOR_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(EDITOR-y)) |
23 | EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c) | 24 | EDITOR_SRC-a:=$(wildcard $(srcdir)/*.c) |
24 | APPLET_SRC-y+=$(EDITOR_SRC-y) | 25 | APPLET_SRC-y+=$(EDITOR_SRC-y) |
25 | APPLET_SRC-a+=$(EDITOR_SRC-a) | 26 | APPLET_SRC-a+=$(EDITOR_SRC-a) |
26 | 27 | ||
27 | editors_OBJ:= $(patsubst %,$(objdir)/%,$(EDITORS-y)) | 28 | needlibm-y:= |
29 | needlibm-$(CONFIG_FEATURE_AWK_MATH) := y | ||
30 | |||
31 | ifeq ($(needlibm-y),y) | ||
32 | LIBRARIES := -lm $(filter-out -lm,$(LIBRARIES)) | ||
33 | endif | ||
28 | 34 | ||
29 | $(editors_OBJ): $(objdir)/%.o: $(srcdir)/%.c | 35 | $(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y)) |
30 | $(objdir)/editors.a: $(editors_OBJ) | 36 | $(do_ar) |
31 | libraries-y:=$(libraries-y) $(objdir)/editors.a | ||
32 | 37 | ||
38 | $(EDITOR_DIR)%.o: $(srcdir)/%.c | ||
39 | $(compile.c) | ||