blob: 03a98149eee4e6d2d78b39ab5f76c31aefdad61a [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
Rob Landleye1d96332005-08-24 00:41:52 +000010
Mike Frysinger51a43b42005-09-24 07:11:16 +000011E2FSPROGS_CFLAGS := -I$(E2FSPROGS_DIR) -include $(E2FSPROGS_DIR)/e2fsbb.h
Eric Andersen9cc7f322005-05-11 23:20:09 +000012
"Vladimir N. Oleynik"b71e6022005-09-19 13:48:39 +000013BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000014 probe.c read.c resolve.c save.c tag.c resolve.c
Mike Frysinger174808c2005-06-11 01:14:09 +000015BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
16BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
17
Mike Frysinger51a43b42005-09-24 07:11:16 +000018E2FSCK_SRC := badblocks.c dict.c dirinfo.c dx_dirinfo.c e2fsck.c \
19 ea_refcount.c ehandler.c journal.c message.c pass1.c pass1b.c \
20 pass2.c pass3.c pass4.c pass5.c problem.c recovery.c region.c \
21 rehash.c revoke.c super.c swapfs.c util.c
22E2FSCK_SRCS := $(patsubst %,e2fsck/%, $(E2FSCK_SRC))
23E2FSCK_OBJS := $(patsubst %.c,%.o, $(E2FSCK_SRCS))
24
Mike Frysinger174808c2005-06-11 01:14:09 +000025E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000026 feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
27 parse_num.c
Mike Frysingerf3d28842005-06-11 00:27:50 +000028E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
29E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
Eric Andersen9cc7f322005-05-11 23:20:09 +000030
Mike Frysinger174808c2005-06-11 01:14:09 +000031EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000032 rw_bitmaps.c initialize.c bitmaps.c block.c \
33 ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
34 openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
35 getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
36 bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
Mike Frysinger51a43b42005-09-24 07:11:16 +000037 dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
38 dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
39 ext_attr.c bmap.c dblist_dir.c
Mike Frysinger174808c2005-06-11 01:14:09 +000040EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
41EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
42
43UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000044 uuid_time.c
Mike Frysinger174808c2005-06-11 01:14:09 +000045UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
46UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
47
Mike Frysingerd89e5e62005-04-24 05:15:12 +000048E2FSPROGS-:=
Mike Frysinger174808c2005-06-11 01:14:09 +000049E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
Mike Frysinger51a43b42005-09-24 07:11:16 +000050E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o $(BLKID_OBJS) $(E2FSCK_OBJS)
51E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o
Mike Frysinger174808c2005-06-11 01:14:09 +000052E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
Mike Frysinger6447ac02005-06-11 05:29:40 +000053E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysinger174808c2005-06-11 01:14:09 +000054E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysingerd89e5e62005-04-24 05:15:12 +000055
Mike Frysinger51a43b42005-09-24 07:11:16 +000056libraries-y+=$(E2FSPROGS_DIR)/$(E2FSPROGS_AR)
Mike Frysingerd89e5e62005-04-24 05:15:12 +000057
Eric Andersen9cc7f322005-05-11 23:20:09 +000058
Mike Frysinger51a43b42005-09-24 07:11:16 +000059$(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
60 $(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
Mike Frysingerd89e5e62005-04-24 05:15:12 +000061
Mike Frysinger51a43b42005-09-24 07:11:16 +000062$(E2FSPROGS_DIR)/%.o: $(E2FSPROGS_DIR)/%.c
Mike Frysinger7ffce0c2005-06-11 00:45:50 +000063 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $<