blob: 1c63311ca206e1a38fd9c2e7a7ff125722913686 [file] [log] [blame]
Eric Andersen85208e22002-04-12 12:05:57 +00001# Makefile for busybox
2#
Eric Andersenc7bda1c2004-03-15 08:29:22 +00003# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Eric Andersen85208e22002-04-12 12:05:57 +00004#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20UTILLINUX_AR:=util-linux.a
21ifndef $(UTILLINUX_DIR)
Eric Andersen7daa0762004-10-08 07:46:08 +000022UTILLINUX_DIR:=$(top_builddir)/util-linux/
Eric Andersen85208e22002-04-12 12:05:57 +000023endif
Eric Andersen7daa0762004-10-08 07:46:08 +000024srcdir=$(top_srcdir)/util-linux
Eric Andersen85208e22002-04-12 12:05:57 +000025
26UTILLINUX-:=
Eric Andersen823b1722004-05-26 11:50:37 +000027UTILLINUX-$(CONFIG_DMESG) +=dmesg.o
28UTILLINUX-$(CONFIG_FBSET) +=fbset.o
29UTILLINUX-$(CONFIG_FDFLUSH) +=fdflush.o
30UTILLINUX-$(CONFIG_FDFORMAT) +=fdformat.o
31UTILLINUX-$(CONFIG_FDISK) +=fdisk.o
32UTILLINUX-$(CONFIG_FREERAMDISK) +=freeramdisk.o
33UTILLINUX-$(CONFIG_FSCK_MINIX) +=fsck_minix.o
34UTILLINUX-$(CONFIG_GETOPT) +=getopt.o
35UTILLINUX-$(CONFIG_HEXDUMP) +=hexdump.o
36UTILLINUX-$(CONFIG_HWCLOCK) +=hwclock.o
Rob Landley6eb1e412005-06-20 04:30:36 +000037UTILLINUX-$(CONFIG_IPCRM) +=ipcrm.o
38UTILLINUX-$(CONFIG_IPCS) +=ipcs.o
Eric Andersen823b1722004-05-26 11:50:37 +000039UTILLINUX-$(CONFIG_LOSETUP) +=losetup.o
40UTILLINUX-$(CONFIG_MKFS_MINIX) +=mkfs_minix.o
41UTILLINUX-$(CONFIG_MKSWAP) +=mkswap.o
42UTILLINUX-$(CONFIG_MORE) +=more.o
43UTILLINUX-$(CONFIG_MOUNT) +=mount.o
44UTILLINUX-$(CONFIG_NFSMOUNT) +=nfsmount.o
45UTILLINUX-$(CONFIG_PIVOT_ROOT) +=pivot_root.o
46UTILLINUX-$(CONFIG_RDATE) +=rdate.o
47UTILLINUX-$(CONFIG_SWAPONOFF) +=swaponoff.o
48UTILLINUX-$(CONFIG_UMOUNT) +=umount.o
Paul Mundt8b2d02e2005-05-20 17:22:18 +000049UTILLINUX-$(CONFIG_READPROFILE) +=readprofile.o
Eric Andersen85208e22002-04-12 12:05:57 +000050
51libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
52
53$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
Mike Frysinger4d008962005-07-27 01:09:24 +000054 $(AR) $(ARFLAGS) $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
Eric Andersen85208e22002-04-12 12:05:57 +000055
Eric Andersen7daa0762004-10-08 07:46:08 +000056$(UTILLINUX_DIR)%.o: $(srcdir)/%.c
57 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
58
Eric Andersen42f88832004-05-26 11:59:19 +000059ifneq ($(strip $(CONFIG_LFS)),y)
60ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y)
61
Eric Andersen7daa0762004-10-08 07:46:08 +000062$(UTILLINUX_DIR)fdisk.o: $(srcdir)/fdisk.c
Eric Andersen42f88832004-05-26 11:59:19 +000063 $(CC) $(CFLAGS) \
64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
65 $(EXTRA_CFLAGS) -c -o $@ $<
66
67endif
68endif