busybox/e2fsprogs/Makefile.in
Bernhard Reutner-Fischer 5c071bcf2f - fix building out-of-tree;
to test, checkout the source (let's assume /scratch/src/busybox), then
  mkdir /tmp/bb ; cd /tmp/bb
  make top_srcdir=/scratch/src/busybox O="$(pwd)" -f /scratch/src/busybox/Makefile allyesconfig check
- default to O=$(pwd) if no O was specified. Now you can just specify
  the top_srcdir (without O=/somewhere) to create the obj-tree in pwd.
- make "make configtarget buildtarget" work. Previously this didn't
  work due to how HAVE_DOT_CONFIG was evaluated. Two separate steps were
  needed before, e.g. make config ; make busybox.
- remove some unneeded variables from Rules.mak (BB_SRC_DIR from Mr.
  ldoolitt@recycle.lbl) which suggest that the stuff fixed above
  didn't work before.
- move selinux libraries to where they belong (from Makefile to Rules.mak)
- update the docs to mention svn instead of cvs and provide an example
  for building out-of-tree in INSTALL.
2005-10-05 07:40:46 +00:00

70 lines
3.0 KiB
Makefile

# Makefile for busybox
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
E2FSPROGS_AR:=e2fsprogs.a
E2FSPROGS_DIR:=$(top_builddir)/e2fsprogs
E2FSPROGS_INC:=$(top_srcdir)/e2fsprogs
E2FSPROGS_CFLAGS := -I$(E2FSPROGS_INC) -include $(E2FSPROGS_INC)/e2fsbb.h
BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
probe.c read.c resolve.c save.c tag.c
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 \
feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
parse_num.c
E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
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 \
ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c
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 \
uuid_time.c
UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
# for building out-of-tree we need to make sure that the directories to hold
# the object tree are created
$(patsubst %,$(E2FSPROGS_DIR)/%, blkid e2fsck e2p ext2fs uuid):
mkdir -p "$@"
$(patsubst %,$(E2FSPROGS_DIR)/%, $(BLKID_OBJS)):$(E2FSPROGS_DIR)/blkid
$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSCK_OBJS)):$(E2FSPROGS_DIR)/e2fsck
$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2P_OBJS)):$(E2FSPROGS_DIR)/e2p
$(patsubst %,$(E2FSPROGS_DIR)/%, $(EXT2FS_OBJS)):$(E2FSPROGS_DIR)/ext2fs
$(patsubst %,$(E2FSPROGS_DIR)/%, $(UUID_OBJS)):$(E2FSPROGS_DIR)/uuid
E2FSPROGS-y:=
E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o $(BLKID_OBJS) $(UUID_OBJS)
E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
libraries-y+=$(E2FSPROGS_DIR)/$(E2FSPROGS_AR)
$(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
$(E2FSPROGS_DIR)/%.o: $(subst $(top_builddir),$(top_srcdir),$(E2FSPROGS_DIR)/%.c)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $<