blob: cd358497531db1e29dd0fb1c307782b56ea58bfc [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 Frysingerd89e5e62005-04-24 05:15:12 +00009E2FSPROGS_DIR:=$(top_builddir)/e2fsprogs/
Rob Landleye1d96332005-08-24 00:41:52 +000010
Mike Frysingerd89e5e62005-04-24 05:15:12 +000011srcdir=$(top_srcdir)/e2fsprogs
12
Rob Landleye1d96332005-08-24 00:41:52 +000013E2FSPROGS_CFLAGS := -I$(srcdir) -include $(srcdir)/e2fsbb.h
Eric Andersen9cc7f322005-05-11 23:20:09 +000014
"Vladimir N. Oleynik"b71e6022005-09-19 13:48:39 +000015BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000016 probe.c read.c resolve.c save.c tag.c resolve.c
Mike Frysinger174808c2005-06-11 01:14:09 +000017BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
18BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
19
20E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000021 feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
22 parse_num.c
Mike Frysingerf3d28842005-06-11 00:27:50 +000023E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
24E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
Eric Andersen9cc7f322005-05-11 23:20:09 +000025
Mike Frysinger174808c2005-06-11 01:14:09 +000026EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000027 rw_bitmaps.c initialize.c bitmaps.c block.c \
28 ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
29 openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
30 getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
31 bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
32 dir_iterate.c link.c res_gdt.c
Mike Frysinger174808c2005-06-11 01:14:09 +000033EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
34EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
35
36UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
Mike Frysinger97b43a72005-09-24 05:58:39 +000037 uuid_time.c
Mike Frysinger174808c2005-06-11 01:14:09 +000038UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
39UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
40
Mike Frysingerd89e5e62005-04-24 05:15:12 +000041E2FSPROGS-:=
Mike Frysinger174808c2005-06-11 01:14:09 +000042E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
43E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
Mike Frysinger6447ac02005-06-11 05:29:40 +000044E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysinger174808c2005-06-11 01:14:09 +000045E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
Mike Frysingerd89e5e62005-04-24 05:15:12 +000046
47libraries-y+=$(E2FSPROGS_DIR)$(E2FSPROGS_AR)
48
Eric Andersen9cc7f322005-05-11 23:20:09 +000049
Mike Frysingerd89e5e62005-04-24 05:15:12 +000050$(E2FSPROGS_DIR)$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)%, $(E2FSPROGS-y))
Mike Frysinger4d008962005-07-27 01:09:24 +000051 $(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)%, $(E2FSPROGS-y))
Mike Frysingerd89e5e62005-04-24 05:15:12 +000052
53$(E2FSPROGS_DIR)%.o: $(srcdir)/%.c
Mike Frysinger7ffce0c2005-06-11 00:45:50 +000054 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $<