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 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 7 | UTILLINUX_AR:=util-linux.a |
| 8 | ifndef $(UTILLINUX_DIR) |
| 9 | UTILLINUX_DIR:=$(top_builddir)/util-linux/ |
| 10 | endif |
| 11 | srcdir=$(top_srcdir)/util-linux |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 12 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 13 | UTILLINUX-y:= |
| 14 | UTILLINUX-$(CONFIG_DMESG) +=dmesg.o |
| 15 | UTILLINUX-$(CONFIG_FBSET) +=fbset.o |
Rob Landley | 0b22c1c | 2006-03-14 02:40:51 +0000 | [diff] [blame] | 16 | UTILLINUX-$(CONFIG_FDFLUSH) +=freeramdisk.o |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 17 | UTILLINUX-$(CONFIG_FDFORMAT) +=fdformat.o |
| 18 | UTILLINUX-$(CONFIG_FDISK) +=fdisk.o |
| 19 | UTILLINUX-$(CONFIG_FREERAMDISK) +=freeramdisk.o |
| 20 | UTILLINUX-$(CONFIG_FSCK_MINIX) +=fsck_minix.o |
| 21 | UTILLINUX-$(CONFIG_GETOPT) +=getopt.o |
| 22 | UTILLINUX-$(CONFIG_HEXDUMP) +=hexdump.o |
| 23 | UTILLINUX-$(CONFIG_HWCLOCK) +=hwclock.o |
| 24 | UTILLINUX-$(CONFIG_IPCRM) +=ipcrm.o |
| 25 | UTILLINUX-$(CONFIG_IPCS) +=ipcs.o |
| 26 | UTILLINUX-$(CONFIG_LOSETUP) +=losetup.o |
| 27 | UTILLINUX-$(CONFIG_MDEV) +=mdev.o |
| 28 | UTILLINUX-$(CONFIG_MKFS_MINIX) +=mkfs_minix.o |
| 29 | UTILLINUX-$(CONFIG_MKSWAP) +=mkswap.o |
| 30 | UTILLINUX-$(CONFIG_MORE) +=more.o |
| 31 | UTILLINUX-$(CONFIG_MOUNT) +=mount.o |
| 32 | UTILLINUX-$(CONFIG_FEATURE_MOUNT_NFS) +=nfsmount.o |
| 33 | UTILLINUX-$(CONFIG_PIVOT_ROOT) +=pivot_root.o |
| 34 | UTILLINUX-$(CONFIG_RDATE) +=rdate.o |
| 35 | UTILLINUX-$(CONFIG_READPROFILE) +=readprofile.o |
| 36 | UTILLINUX-$(CONFIG_SETARCH) +=setarch.o |
| 37 | UTILLINUX-$(CONFIG_SWAPONOFF) +=swaponoff.o |
| 38 | UTILLINUX-$(CONFIG_SWITCH_ROOT) +=switch_root.o |
| 39 | UTILLINUX-$(CONFIG_UMOUNT) +=umount.o |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 40 | |
Bernhard Reutner-Fischer | 2dd13bd | 2006-03-24 09:48:18 +0000 | [diff] [blame] | 41 | UTILLINUX-y:=$(sort $(UTILLINUX-y)) |
| 42 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 43 | ifneq ($(strip $(UTILLINUX-y)),) |
| 44 | libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR) |
| 45 | endif |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 46 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 47 | UTILLINUX_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(UTILLINUX-y)) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 48 | UTILLINUX_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 49 | APPLET_SRC-y+=$(UTILLINUX_SRC-y) |
| 50 | APPLET_SRC-a+=$(UTILLINUX_SRC-a) |
| 51 | |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 52 | $(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y)) |
| 53 | $(do_ar) |
| 54 | |
| 55 | $(UTILLINUX_DIR)%.o: $(srcdir)/%.c |
| 56 | $(compile.c) |
| 57 | |
Eric Andersen | 42f8883 | 2004-05-26 11:59:19 +0000 | [diff] [blame] | 58 | ifneq ($(strip $(CONFIG_LFS)),y) |
| 59 | ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y) |
Bernhard Reutner-Fischer | df10094 | 2006-03-13 19:04:00 +0000 | [diff] [blame] | 60 | |
| 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 Andersen | 42f8883 | 2004-05-26 11:59:19 +0000 | [diff] [blame] | 66 | endif |
| 67 | endif |