blob: 80b6da0b1b54bb7f22a696db08bbffebf800067c [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
7APPLETS_AR:=applets.a
8ifndef $(APPLETS_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +00009APPLETS_DIR:=$(top_builddir)/applets/
Eric Andersen85208e22002-04-12 12:05:57 +000010endif
Eric Andersen7daa0762004-10-08 07:46:08 +000011srcdir=$(top_srcdir)/applets
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000013APPLET_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c)
14APPLET_OBJ:= $(patsubst $(srcdir)/%.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
15
16APPLET_SRC-y+=$(APPLET_SRC)
17APPLET_SRC-a+=$(APPLET_SRC)
Eric Andersen85208e22002-04-12 12:05:57 +000018
19libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
20
Eric Andersen85208e22002-04-12 12:05:57 +000021$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
Mike Frysinger4d008962005-07-27 01:09:24 +000022 $(AR) $(ARFLAGS) $@ $(APPLET_OBJ)
Eric Andersen85208e22002-04-12 12:05:57 +000023
Bernhard Reutner-Fischer14b1c1d2005-10-05 14:52:21 +000024$(APPLET_OBJ): $(top_builddir)/.config
Eric Andersen7daa0762004-10-08 07:46:08 +000025$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
26 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
27