2005-04-24 10:45:12 +05:30
|
|
|
# Makefile for busybox
|
|
|
|
#
|
|
|
|
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
|
|
|
|
#
|
2005-09-24 11:31:57 +05:30
|
|
|
# Licensed under the GPL v2, see the file LICENSE in this tarball.
|
2005-04-24 10:45:12 +05:30
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
srcdir:=$(top_srcdir)/e2fsprogs
|
|
|
|
objdir:=$(top_builddir)/e2fsprogs
|
2005-05-12 04:50:09 +05:30
|
|
|
|
2005-09-19 19:18:39 +05:30
|
|
|
BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
|
2005-09-30 13:55:50 +05:30
|
|
|
probe.c read.c resolve.c save.c tag.c
|
2005-06-11 06:44:09 +05:30
|
|
|
BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
|
|
|
|
BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
|
|
|
|
|
|
|
|
E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
|
2005-09-27 17:13:29 +05:30
|
|
|
feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
|
|
|
|
parse_num.c
|
2005-06-11 05:57:50 +05:30
|
|
|
E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
|
|
|
|
E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
|
2005-05-12 04:50:09 +05:30
|
|
|
|
2005-06-11 06:44:09 +05:30
|
|
|
EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
|
2005-09-27 17:13:29 +05:30
|
|
|
rw_bitmaps.c initialize.c bitmaps.c block.c \
|
|
|
|
ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
|
|
|
|
openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
|
|
|
|
getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
|
|
|
|
bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
|
|
|
|
dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
|
|
|
|
dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
|
2006-01-24 03:08:06 +05:30
|
|
|
ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c swapfs.c
|
2005-06-11 06:44:09 +05:30
|
|
|
EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
|
|
|
|
EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
|
|
|
|
|
|
|
|
UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
|
2005-09-27 17:13:29 +05:30
|
|
|
uuid_time.c
|
2005-06-11 06:44:09 +05:30
|
|
|
UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
|
|
|
|
UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
|
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
|
2005-10-05 13:10:46 +05:30
|
|
|
# for building out-of-tree we need to make sure that the directories to hold
|
|
|
|
# the object tree are created
|
2006-03-02 04:24:48 +05:30
|
|
|
$(patsubst %,$(objdir)/%, blkid e2fsck e2p ext2fs uuid):
|
2005-10-05 15:36:11 +05:30
|
|
|
@mkdir -p "$@"
|
2005-10-05 13:10:46 +05:30
|
|
|
|
2005-10-05 15:36:11 +05:30
|
|
|
# make sure that the directories are order-only prerequisites. Otherwise we
|
|
|
|
# may have object files created after the timestamp of the directory was
|
|
|
|
# updated which would lead to spurious rebuilds (as some of the dentries
|
|
|
|
# may be older than the dir itself).
|
2006-03-09 14:33:37 +05:30
|
|
|
ifeq ($(MAKE_VERSION),3.81beta4)
|
2006-03-06 19:50:43 +05:30
|
|
|
# alleged bug in 3.81beta4. Stripping dir from dir/files.c
|
|
|
|
# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c
|
|
|
|
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/%.c |$(objdir)/blkid
|
2006-03-02 04:24:48 +05:30
|
|
|
$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/%.c|$(objdir)/e2fsck
|
2006-03-06 19:50:43 +05:30
|
|
|
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/%.c |$(objdir)/e2p
|
2006-03-02 04:24:48 +05:30
|
|
|
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/%.c|$(objdir)/ext2fs
|
2006-03-06 19:50:43 +05:30
|
|
|
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/%.c |$(objdir)/uuid
|
2006-03-09 14:33:37 +05:30
|
|
|
|
|
|
|
e2fsprogs-rules-seen:=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MAKE_VERSION),3.79.1)
|
|
|
|
# no order-only prerequesites
|
|
|
|
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c #|$(objdir)/blkid
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c#|$(objdir)/e2fsck
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c #|$(objdir)/e2p
|
|
|
|
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c#|$(objdir)/ext2fs
|
|
|
|
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c #|$(objdir)/uuid
|
|
|
|
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
|
|
|
|
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
|
|
|
|
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
|
|
|
|
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
|
|
|
|
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
|
|
|
|
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
|
|
|
|
|
|
|
|
e2fsprogs-rules-seen:=1
|
2006-03-06 19:50:43 +05:30
|
|
|
endif
|
2005-10-05 13:10:46 +05:30
|
|
|
|
2006-03-09 14:33:37 +05:30
|
|
|
ifndef e2fsprogs-rules-seen
|
|
|
|
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
|
|
|
|
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c |$(objdir)/e2p
|
|
|
|
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
|
|
|
|
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c |$(objdir)/uuid
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2005-06-11 06:44:09 +05:30
|
|
|
E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
|
2005-10-05 06:22:37 +05:30
|
|
|
E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
|
2005-10-12 21:52:19 +05:30
|
|
|
E2FSPROGS-$(CONFIG_FSCK) += fsck.o util.o $(BLKID_OBJS) $(UUID_OBJS)
|
2005-06-11 06:44:09 +05:30
|
|
|
E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
|
2005-06-11 10:59:40 +05:30
|
|
|
E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
|
2005-06-11 06:44:09 +05:30
|
|
|
E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
|
2005-04-24 10:45:12 +05:30
|
|
|
|
2006-01-15 19:34:57 +05:30
|
|
|
E2FSPROGS-y:=$(sort $(E2FSPROGS-y))
|
2006-03-02 04:24:48 +05:30
|
|
|
ifneq ($(E2FSPROGS-y),)
|
|
|
|
CFLAGS-e2fsprogs := -include $(srcdir)/e2fsbb.h
|
2006-02-22 00:41:35 +05:30
|
|
|
endif
|
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
E2FSPROGS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(E2FSPROGS-y))
|
|
|
|
E2FSPROGS_SRC-a:=$(wildcard $(srcdir)/*.c) $(patsubst %,$(srcdir)/%,$(BLKID_SRCS) $(E2P_SRCS) $(EXT2FS_SRCS) $(UUID_SRCS))
|
|
|
|
APPLET_SRC-y+=$(E2FSPROGS_SRC-y)
|
|
|
|
APPLET_SRC-a+=$(E2FSPROGS_SRC-a)
|
|
|
|
|
|
|
|
$(warning FIXME: change .c to include their stuff relative to $(srcdir))
|
|
|
|
E2FSPROGS_TMP_KLUDGE:=$(patsubst %,-I$(srcdir)/%,blkid e2fsck e2p ext2fs uuid)
|
|
|
|
CFLAGS-blkid=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
|
|
|
|
CFLAGS-e2fsck=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
|
|
|
|
CFLAGS-e2p=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
|
|
|
|
CFLAGS-ext2fs=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
|
|
|
|
CFLAGS-uuid=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
|
2006-01-15 19:34:57 +05:30
|
|
|
|
2005-04-24 10:45:12 +05:30
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
APPLETS_DEFINE-y+=$(CFLAGS-e2fsprogs) -I$(srcdir) $(E2FSPROGS_TMP_KLUDGE)
|
|
|
|
APPLETS_DEFINE-a+=$(CFLAGS-e2fsprogs) -I$(srcdir) $(E2FSPROGS_TMP_KLUDGE)
|
2005-05-12 04:50:09 +05:30
|
|
|
|
2006-03-02 04:24:48 +05:30
|
|
|
e2fsprogs_OBJ:= $(patsubst %,$(objdir)/%,$(E2FSPROGS-y))
|
2005-04-24 10:45:12 +05:30
|
|
|
|
2006-03-09 14:33:37 +05:30
|
|
|
$(e2fsprogs_OBJ): $(objdir)/%.o: $(srcdir)/%.c
|
|
|
|
$(objdir)/e2fsprogs.a: $(e2fsprogs_OBJ)
|
|
|
|
libraries-y:=$(libraries-y) $(objdir)/e2fsprogs.a
|
|
|
|
|