blob: 423d4b6c065e47aa77188de8f1d21acbbf84e802 [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
7UTILLINUX_AR:=util-linux.a
8ifndef $(UTILLINUX_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +00009UTILLINUX_DIR:=$(top_builddir)/util-linux/
Eric Andersen85208e22002-04-12 12:05:57 +000010endif
Eric Andersen7daa0762004-10-08 07:46:08 +000011srcdir=$(top_srcdir)/util-linux
Eric Andersen85208e22002-04-12 12:05:57 +000012
Bernhard Reutner-Fischerbb66a6c2005-10-13 10:24:44 +000013UTILLINUX-y:=
Mike Frysinger95544f72005-09-25 05:23:58 +000014UTILLINUX-$(CONFIG_DMESG) +=dmesg.o
15UTILLINUX-$(CONFIG_FBSET) +=fbset.o
16UTILLINUX-$(CONFIG_FDFLUSH) +=fdflush.o
17UTILLINUX-$(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
Rob Landley70f7ef72005-12-13 08:21:33 +000027UTILLINUX-$(CONFIG_MDEV) +=mdev.o
Mike Frysinger95544f72005-09-25 05:23:58 +000028UTILLINUX-$(CONFIG_MKFS_MINIX) +=mkfs_minix.o
29UTILLINUX-$(CONFIG_MKSWAP) +=mkswap.o
30UTILLINUX-$(CONFIG_MORE) +=more.o
31UTILLINUX-$(CONFIG_MOUNT) +=mount.o
Rob Landley4a7252b2005-10-08 18:49:45 +000032UTILLINUX-$(CONFIG_FEATURE_MOUNT_NFS) +=nfsmount.o
Mike Frysinger95544f72005-09-25 05:23:58 +000033UTILLINUX-$(CONFIG_PIVOT_ROOT) +=pivot_root.o
34UTILLINUX-$(CONFIG_RDATE) +=rdate.o
35UTILLINUX-$(CONFIG_READPROFILE) +=readprofile.o
Mike Frysinger0a6b0bf2006-02-21 04:26:52 +000036UTILLINUX-$(CONFIG_SETARCH) +=setarch.o
Mike Frysinger95544f72005-09-25 05:23:58 +000037UTILLINUX-$(CONFIG_SWAPONOFF) +=swaponoff.o
Bernhard Reutner-Fischer73bffd42005-12-15 11:44:31 +000038UTILLINUX-$(CONFIG_SWITCH_ROOT) +=switch_root.o
Mike Frysinger95544f72005-09-25 05:23:58 +000039UTILLINUX-$(CONFIG_UMOUNT) +=umount.o
Eric Andersen85208e22002-04-12 12:05:57 +000040
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000041
Eric Andersen85208e22002-04-12 12:05:57 +000042libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
43
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000044UTILLINUX_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(UTILLINUX-y))
45UTILLINUX_SRC-a:=$(wildcard $(srcdir)/*.c)
46APPLET_SRC-y+=$(UTILLINUX_SRC-y)
47APPLET_SRC-a+=$(UTILLINUX_SRC-a)
48
Eric Andersen85208e22002-04-12 12:05:57 +000049$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
Mike Frysingerb38673f2006-02-02 01:41:53 +000050 $(do_ar)
Eric Andersen85208e22002-04-12 12:05:57 +000051
Eric Andersen7daa0762004-10-08 07:46:08 +000052$(UTILLINUX_DIR)%.o: $(srcdir)/%.c
Mike Frysingerb38673f2006-02-02 01:41:53 +000053 $(compile.c)
Eric Andersen7daa0762004-10-08 07:46:08 +000054
Eric Andersen42f88832004-05-26 11:59:19 +000055ifneq ($(strip $(CONFIG_LFS)),y)
56ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y)
57
Eric Andersen7daa0762004-10-08 07:46:08 +000058$(UTILLINUX_DIR)fdisk.o: $(srcdir)/fdisk.c
Eric Andersen42f88832004-05-26 11:59:19 +000059 $(CC) $(CFLAGS) \
60 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
61 $(EXTRA_CFLAGS) -c -o $@ $<
62
63endif
64endif