blob: d1ab73e8c37c01438abd465c87088cd7bd436297 [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
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +00007UTILLINUX_AR:=util-linux.a
8ifndef $(UTILLINUX_DIR)
9UTILLINUX_DIR:=$(top_builddir)/util-linux/
10endif
11srcdir=$(top_srcdir)/util-linux
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000013UTILLINUX-y:=
14UTILLINUX-$(CONFIG_DMESG) +=dmesg.o
15UTILLINUX-$(CONFIG_FBSET) +=fbset.o
Rob Landley0b22c1c2006-03-14 02:40:51 +000016UTILLINUX-$(CONFIG_FDFLUSH) +=freeramdisk.o
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000017UTILLINUX-$(CONFIG_FDFORMAT) +=fdformat.o
18UTILLINUX-$(CONFIG_FDISK) +=fdisk.o
19UTILLINUX-$(CONFIG_FREERAMDISK) +=freeramdisk.o
20UTILLINUX-$(CONFIG_FSCK_MINIX) +=fsck_minix.o
21UTILLINUX-$(CONFIG_GETOPT) +=getopt.o
22UTILLINUX-$(CONFIG_HEXDUMP) +=hexdump.o
23UTILLINUX-$(CONFIG_HWCLOCK) +=hwclock.o
24UTILLINUX-$(CONFIG_IPCRM) +=ipcrm.o
25UTILLINUX-$(CONFIG_IPCS) +=ipcs.o
26UTILLINUX-$(CONFIG_LOSETUP) +=losetup.o
27UTILLINUX-$(CONFIG_MDEV) +=mdev.o
28UTILLINUX-$(CONFIG_MKFS_MINIX) +=mkfs_minix.o
29UTILLINUX-$(CONFIG_MKSWAP) +=mkswap.o
30UTILLINUX-$(CONFIG_MORE) +=more.o
31UTILLINUX-$(CONFIG_MOUNT) +=mount.o
32UTILLINUX-$(CONFIG_FEATURE_MOUNT_NFS) +=nfsmount.o
33UTILLINUX-$(CONFIG_PIVOT_ROOT) +=pivot_root.o
34UTILLINUX-$(CONFIG_RDATE) +=rdate.o
35UTILLINUX-$(CONFIG_READPROFILE) +=readprofile.o
36UTILLINUX-$(CONFIG_SETARCH) +=setarch.o
37UTILLINUX-$(CONFIG_SWAPONOFF) +=swaponoff.o
38UTILLINUX-$(CONFIG_SWITCH_ROOT) +=switch_root.o
39UTILLINUX-$(CONFIG_UMOUNT) +=umount.o
Eric Andersen85208e22002-04-12 12:05:57 +000040
Bernhard Reutner-Fischer2dd13bd2006-03-24 09:48:18 +000041UTILLINUX-y:=$(sort $(UTILLINUX-y))
42
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000043ifneq ($(strip $(UTILLINUX-y)),)
44libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
45endif
Eric Andersen85208e22002-04-12 12:05:57 +000046
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000047UTILLINUX_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(UTILLINUX-y))
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000048UTILLINUX_SRC-a:=$(wildcard $(srcdir)/*.c)
49APPLET_SRC-y+=$(UTILLINUX_SRC-y)
50APPLET_SRC-a+=$(UTILLINUX_SRC-a)
51
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000052$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
53 $(do_ar)
54
55$(UTILLINUX_DIR)%.o: $(srcdir)/%.c
56 $(compile.c)
57
Eric Andersen42f88832004-05-26 11:59:19 +000058ifneq ($(strip $(CONFIG_LFS)),y)
59ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y)
Bernhard Reutner-Fischerdf100942006-03-13 19:04:00 +000060
61$(UTILLINUX_DIR)fdisk.o: $(srcdir)/fdisk.c
62 $(CC) $(CFLAGS) \
63 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
64 $(EXTRA_CFLAGS) -c -o $@ $<
65
Eric Andersen42f88832004-05-26 11:59:19 +000066endif
67endif