Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Mike Frysinger | 0d4ee68 | 2005-09-24 06:01:57 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 4 | # |
Mike Frysinger | 0d4ee68 | 2005-09-24 06:01:57 +0000 | [diff] [blame] | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 6 | |
| 7 | EDITOR_AR:=editors.a |
| 8 | ifndef $(EDITOR_DIR) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 9 | EDITOR_DIR:=$(top_builddir)/editors/ |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 10 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 11 | srcdir=$(top_srcdir)/editors |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 12 | |
| 13 | EDITOR-y:= |
Glenn L McGrath | 545106f | 2002-11-11 06:21:00 +0000 | [diff] [blame] | 14 | EDITOR-$(CONFIG_AWK) += awk.o |
Glenn L McGrath | 655d814 | 2003-06-22 15:32:41 +0000 | [diff] [blame] | 15 | EDITOR-$(CONFIG_PATCH) += patch.o |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 16 | EDITOR-$(CONFIG_SED) += sed.o |
| 17 | EDITOR-$(CONFIG_VI) += vi.o |
| 18 | EDITOR_SRC:= $(EDITOR-y) |
| 19 | EDITOR_OBJ:= $(patsubst %.c,$(EDITOR_DIR)%.o, $(EDITOR_SRC)) |
| 20 | |
| 21 | libraries-y+=$(EDITOR_DIR)$(EDITOR_AR) |
| 22 | |
Glenn L McGrath | 545106f | 2002-11-11 06:21:00 +0000 | [diff] [blame] | 23 | needlibm-y:= |
| 24 | needlibm-$(CONFIG_FEATURE_AWK_MATH) := y |
| 25 | |
| 26 | ifeq ($(needlibm-y),y) |
| 27 | LIBRARIES += -lm |
| 28 | endif |
| 29 | |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 30 | $(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y)) |
Mike Frysinger | 4d00896 | 2005-07-27 01:09:24 +0000 | [diff] [blame] | 31 | $(AR) $(ARFLAGS) $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y)) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 32 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 33 | $(EDITOR_DIR)%.o: $(srcdir)/%.c |
| 34 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 35 | |