blob: 46a684ee71430df290f7953d16f4aa92b8641132 [file] [log] [blame]
Mike Frysingerd89e5e62005-04-24 05:15:12 +00001# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
Mike Frysinger0d4ee682005-09-24 06:01:57 +00005# Licensed under the GPL v2, see the file LICENSE in this tarball.
Mike Frysingerd89e5e62005-04-24 05:15:12 +00006
7E2FSPROGS_AR:=e2fsprogs.a
Rob Landleye1d96332005-08-24 00:41:52 +00008
Mike Frysinger51a43b42005-09-24 07:11:16 +00009E2FSPROGS_DIR:=$(top_builddir)/e2fsprogs
Bernhard Reutner-Fischere6d55392005-09-30 09:46:27 +000010E2FSPROGS_INC:=$(top_srcdir)/e2fsprogs
Rob Landleye1d96332005-08-24 00:41:52 +000011
Bernhard Reutner-Fischerf24e0f52005-09-30 08:25:50 +000012E2FSPROGS_CFLAGS := -I$(E2FSPROGS_INC) -include $(E2FSPROGS_INC)/e2fsbb.h
Eric Andersen9cc7f322005-05-11 23:20:09 +000013
"Vladimir N. Oleynik"b71e6022005-09-19 13:48:39 +000014BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
Bernhard Reutner-Fischerf24e0f52005-09-30 08:25:50 +000015 probe.c read.c resolve.c save.c tag.c
Mike Frysinger174808c2005-06-11 01:14:09 +000016BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
17BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
18
19E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
"Vladimir N. Oleynik"3978e552005-09-27 11:43:29 +000020 feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
21 parse_num.c
Mike Frysingerf3d28842005-06-11 00:27:50 +000022E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
23E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
Eric Andersen9cc7f322005-05-11 23:20:09 +000024
Mike Frysinger174808c2005-06-11 01:14:09 +000025EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
"Vladimir N. Oleynik"3978e552005-09-27 11:43:29 +000026 rw_bitmaps.c initialize.c bitmaps.c block.c \
27 ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
28 openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
29 getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
30 bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
31 dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
32 dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
33 ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c
Mike Frysinger174808c2005-06-11 01:14:09 +000034EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
35EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
36
37UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
"Vladimir N. Oleynik"3978e552005-09-27 11:43:29 +000038 uuid_time.c
Mike Frysinger174808c2005-06-11 01:14:09 +000039UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
40UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
41
Bernhard Reutner-Fischer5c071bc2005-10-05 07:40:46 +000042# for building out-of-tree we need to make sure that the directories to hold
43# the object tree are created
44$(patsubst %,$(E2FSPROGS_DIR)/%, blkid e2fsck e2p ext2fs uuid):
45 mkdir -p "$@"
46
47$(patsubst %,$(E2FSPROGS_DIR)/%, $(BLKID_OBJS)):$(E2FSPROGS_DIR)/blkid
48$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSCK_OBJS)):$(E2FSPROGS_DIR)/e2fsck
49$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2P_OBJS)):$(E2FSPROGS_DIR)/e2p
50$(patsubst %,$(E2FSPROGS_DIR)/%, $(EXT2FS_OBJS)):$(E2FSPROGS_DIR)/ext2fs
51$(patsubst %,$(E2FSPROGS_DIR)/%, $(UUID_OBJS)):$(E2FSPROGS_DIR)/uuid
52
53E2FSPROGS-y:=
Mike Frysinger174808c2005-06-11 01:14:09 +000054E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
Mike Frysingerdc251032005-10-05 00:52:37 +000055E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
56E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o $(BLKID_OBJS) $(UUID_OBJS)
Mike Frysinger174808c2005-06-11 01:14:09 +000057E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
Mike Frysinger6447ac02005-06-11 05:29:40 +000058E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysinger174808c2005-06-11 01:14:09 +000059E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysingerd89e5e62005-04-24 05:15:12 +000060
Mike Frysinger51a43b42005-09-24 07:11:16 +000061libraries-y+=$(E2FSPROGS_DIR)/$(E2FSPROGS_AR)
Mike Frysingerd89e5e62005-04-24 05:15:12 +000062
Eric Andersen9cc7f322005-05-11 23:20:09 +000063
Mike Frysinger51a43b42005-09-24 07:11:16 +000064$(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
65 $(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
Mike Frysingerd89e5e62005-04-24 05:15:12 +000066
Bernhard Reutner-Fischer5c071bc2005-10-05 07:40:46 +000067$(E2FSPROGS_DIR)/%.o: $(subst $(top_builddir),$(top_srcdir),$(E2FSPROGS_DIR)/%.c)
Mike Frysinger7ffce0c2005-06-11 00:45:50 +000068 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $<
Bernhard Reutner-Fischer5c071bc2005-10-05 07:40:46 +000069