- workaround bug in make-3.81beta4:
[oweals/busybox.git] / e2fsprogs / Makefile.in
1 # Makefile for busybox
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4 #
5 # Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7 srcdir:=$(top_srcdir)/e2fsprogs
8 objdir:=$(top_builddir)/e2fsprogs
9
10 BLKID_SRC   := cache.c dev.c devname.c devno.c blkid_getsize.c \
11                probe.c read.c resolve.c save.c tag.c
12 BLKID_SRCS  := $(patsubst %,blkid/%, $(BLKID_SRC))
13 BLKID_OBJS  := $(patsubst %.c,%.o, $(BLKID_SRCS))
14
15 E2P_SRC     := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
16                feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
17                parse_num.c
18 E2P_SRCS    := $(patsubst %,e2p/%, $(E2P_SRC))
19 E2P_OBJS    := $(patsubst %.c,%.o, $(E2P_SRCS))
20
21 EXT2FS_SRC  := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
22                rw_bitmaps.c initialize.c bitmaps.c block.c \
23                ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
24                openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
25                getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
26                bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
27                dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
28                dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
29                ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c swapfs.c
30 EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
31 EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
32
33 UUID_SRC    := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
34                uuid_time.c
35 UUID_SRCS   := $(patsubst %,uuid/%, $(UUID_SRC))
36 UUID_OBJS   := $(patsubst %.c,%.o, $(UUID_SRCS))
37
38
39 # for building out-of-tree we need to make sure that the directories to hold
40 # the object tree are created
41 $(patsubst %,$(objdir)/%, blkid e2fsck e2p ext2fs uuid):
42         @mkdir -p "$@"
43
44 # make sure that the directories are order-only prerequisites. Otherwise we
45 # may have object files created after the timestamp of the directory was
46 # updated which would lead to spurious rebuilds (as some of the dentries
47 # may be older than the dir itself).
48 ifneq ($(MAKE_VERSION),3.81beta4)
49 # /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/dir/file.c
50 $(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
51 $(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
52 $(patsubst %,$(objdir)/%,$(E2P_OBJS)):   $(objdir)/e2p/%.o:   $(srcdir)/e2p/%.c   |$(objdir)/e2p
53 $(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
54 $(patsubst %,$(objdir)/%,$(UUID_OBJS)):  $(objdir)/uuid/%.o:  $(srcdir)/uuid/%.c  |$(objdir)/uuid
55 else
56 # alleged bug in 3.81beta4. Stripping dir from dir/files.c
57 # /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c
58 $(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/%.c |$(objdir)/blkid
59 $(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/%.c|$(objdir)/e2fsck
60 $(patsubst %,$(objdir)/%,$(E2P_OBJS)):   $(objdir)/e2p/%.o:   $(srcdir)/%.c   |$(objdir)/e2p
61 $(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/%.c|$(objdir)/ext2fs
62 $(patsubst %,$(objdir)/%,$(UUID_OBJS)):  $(objdir)/uuid/%.o:  $(srcdir)/%.c  |$(objdir)/uuid
63 endif
64
65 E2FSPROGS-$(CONFIG_CHATTR)     += chattr.o $(E2P_OBJS)
66 E2FSPROGS-$(CONFIG_E2FSCK)     += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
67 E2FSPROGS-$(CONFIG_FSCK)       += fsck.o util.o $(BLKID_OBJS) $(UUID_OBJS)
68 E2FSPROGS-$(CONFIG_LSATTR)     += lsattr.o $(E2P_OBJS)
69 E2FSPROGS-$(CONFIG_MKE2FS)     += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
70 E2FSPROGS-$(CONFIG_TUNE2FS)    += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
71
72 E2FSPROGS-y:=$(sort $(E2FSPROGS-y))
73 ifneq ($(E2FSPROGS-y),)
74 CFLAGS-e2fsprogs := -include $(srcdir)/e2fsbb.h
75 endif
76
77 E2FSPROGS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(E2FSPROGS-y))
78 E2FSPROGS_SRC-a:=$(wildcard $(srcdir)/*.c) $(patsubst %,$(srcdir)/%,$(BLKID_SRCS) $(E2P_SRCS) $(EXT2FS_SRCS) $(UUID_SRCS))
79 APPLET_SRC-y+=$(E2FSPROGS_SRC-y)
80 APPLET_SRC-a+=$(E2FSPROGS_SRC-a)
81
82 $(warning FIXME: change .c to include their stuff relative to $(srcdir))
83 E2FSPROGS_TMP_KLUDGE:=$(patsubst %,-I$(srcdir)/%,blkid e2fsck e2p ext2fs uuid)
84 CFLAGS-blkid=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
85 CFLAGS-e2fsck=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
86 CFLAGS-e2p=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
87 CFLAGS-ext2fs=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
88 CFLAGS-uuid=$(E2FSPROGS_TMP_KLUDGE) $(CFLAGS-e2fsprogs)
89
90
91 APPLETS_DEFINE-y+=$(CFLAGS-e2fsprogs) -I$(srcdir) $(E2FSPROGS_TMP_KLUDGE)
92 APPLETS_DEFINE-a+=$(CFLAGS-e2fsprogs) -I$(srcdir) $(E2FSPROGS_TMP_KLUDGE)
93
94 e2fsprogs_OBJ:=  $(patsubst %,$(objdir)/%,$(E2FSPROGS-y))
95