blob: 5f991cfee44b289a2e96c7e1c8e35d7cd83605a8 [file] [log] [blame]
Theodore Ts'of3db3561997-04-26 13:34:30 +00001all:: libext2fs.a
2
Theodore Ts'o3839e651997-04-26 13:21:57 +00003include ../../MCONFIG
4
Theodore Ts'of3db3561997-04-26 13:34:30 +00005OBJS= ext2_err.o openfs.o freefs.o closefs.o bitmaps.o rw_bitmaps.o inode.o \
6 unix_io.o block.o namei.o newdir.o mkdir.o check_desc.o \
7 get_pathname.o bitops.o link.o alloc.o expanddir.o inline.o \
8 initialize.o badblocks.o read_bb.o bb_inode.o read_bb_file.o llseek.o
9
10HFILES= bitops.h ext2_err.h ext2fs.h io.h
11
12ifdef BUILD_PROFILE_LIBS
13all:: libext2fs_p.a
14endif
15
16ifdef BUILD_DLL_SHLIBS
17DLL_ADDRESS = 0x66900000
18DLL_JUMPSIZE = 0x1000
19DLL_GOTSIZE = 0x1000
20DLL_VERSION = 1.0
21DLL_IMAGE = libe2fs
22DLL_STUB = libext2fs
23DLL_LIBS = -L../.. -lcom_err
24DLL_MYDIR = ext2fs
25DLL_INSTALL_DIR = $(SHLIBDIR)
26
27include ../Makefile.dll-lib
28endif
29
Theodore Ts'o3839e651997-04-26 13:21:57 +000030COMPILE_ET=../et/compile_et
31
32CFLAGS_NO= $(WFLAGS) -I..
33CFLAGS= $(OPT) $(CFLAGS_NO)
34LDFLAGS= $(OPT)
35
Theodore Ts'o3839e651997-04-26 13:21:57 +000036RM=rm -f
37MV=mv
38LN=ln -s
39
Theodore Ts'o3839e651997-04-26 13:21:57 +000040DISTFILES= Makefile *.c *.h image
41
42.c.o:
43 $(CC) $(CFLAGS) -c $*.c
Theodore Ts'of3db3561997-04-26 13:34:30 +000044ifdef BUILD_PROFILE_LIBS
Theodore Ts'o3839e651997-04-26 13:21:57 +000045 $(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c
Theodore Ts'of3db3561997-04-26 13:34:30 +000046endif
Theodore Ts'o3839e651997-04-26 13:21:57 +000047# $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c
Theodore Ts'of3db3561997-04-26 13:34:30 +000048ifdef BUILD_DLL_SHLIBS
49 (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \
50 -o jump/$*.o -c $*.c)
51endif
Theodore Ts'o3839e651997-04-26 13:21:57 +000052
53libext2fs.a: $(OBJS)
54 $(RM) $@.bak
55 -$(MV) $@ $@.bak
56 $(ARCHIVE) $@ $(OBJS)
57 $(RANLIB) $@
58 $(RM) ../$@
59 $(LN) ext2fs/$@ ../$@
60
61libext2fs_p.a: $(OBJS)
62 $(RM) $@.bak
63 -$(MV) $@ $@.bak
64 (cd profiled; $(ARCHIVE) ../$@ $(OBJS))
65 $(RANLIB) $@
66 $(RM) ../$@
67 $(LN) ext2fs/$@ ../$@
68
69libext2fs_chk.a: $(OBJS)
70 $(RM) $@.bak
71 -$(MV) $@ $@.bak
72 (cd checker; $(ARCHIVE) ../$@ $(OBJS))
73 $(RANLIB) $@
74 $(RM) ../$@
75 $(LN) ext2fs/$@ ../$@
76
77ext2_err.c ext2_err.h: ext2_err.et
78 $(COMPILE_ET) ext2_err.et
79
Theodore Ts'of3db3561997-04-26 13:34:30 +000080install-libs:: all
81 $(INSTALLLIB) libext2fs.a $(LIBDIR)/libext2fs.a
82 $(CHMOD) 644 $(LIBDIR)/libext2fs.a
83 $(RANLIB) $(LIBDIR)/libext2fs.a
84 $(CHMOD) $(LIBMODE) $(LIBDIR)/libext2fs.a
Theodore Ts'o3839e651997-04-26 13:21:57 +000085
Theodore Ts'of3db3561997-04-26 13:34:30 +000086install-libs:: $(HFILES)
87 @rm -rf $(INCLDIR)/ext2fs
88 @mkdir $(INCLDIR)/ext2fs
Theodore Ts'o3839e651997-04-26 13:21:57 +000089 for i in $(HFILES); do \
Theodore Ts'of3db3561997-04-26 13:34:30 +000090 $(INSTALLINC) $$i $(INCLDIR)/ext2fs/$$i; \
Theodore Ts'o3839e651997-04-26 13:21:57 +000091 done
92
Theodore Ts'of3db3561997-04-26 13:34:30 +000093install-tree::
Theodore Ts'o3839e651997-04-26 13:21:57 +000094
Theodore Ts'of3db3561997-04-26 13:34:30 +000095install::
96
97clean::
98 rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
99 rm -f ../libext2fs.a ../libext2fs_p.a ../libext2fs_chk.a
100
101really-clean:: clean
Theodore Ts'o3839e651997-04-26 13:21:57 +0000102 rm -f .depend ext2_err.c ext2_err.h
103
104dep depend .depend: ext2_err.h
105 $(CC) -M $(CFLAGS) *.c >.depend
106
107include .depend