Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 1 | all:: libext2fs.a |
| 2 | |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 3 | include ../../MCONFIG |
| 4 | |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 5 | OBJS= 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 | |
| 10 | HFILES= bitops.h ext2_err.h ext2fs.h io.h |
| 11 | |
| 12 | ifdef BUILD_PROFILE_LIBS |
| 13 | all:: libext2fs_p.a |
| 14 | endif |
| 15 | |
| 16 | ifdef BUILD_DLL_SHLIBS |
| 17 | DLL_ADDRESS = 0x66900000 |
| 18 | DLL_JUMPSIZE = 0x1000 |
| 19 | DLL_GOTSIZE = 0x1000 |
| 20 | DLL_VERSION = 1.0 |
| 21 | DLL_IMAGE = libe2fs |
| 22 | DLL_STUB = libext2fs |
| 23 | DLL_LIBS = -L../.. -lcom_err |
| 24 | DLL_MYDIR = ext2fs |
| 25 | DLL_INSTALL_DIR = $(SHLIBDIR) |
| 26 | |
| 27 | include ../Makefile.dll-lib |
| 28 | endif |
| 29 | |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 30 | COMPILE_ET=../et/compile_et |
| 31 | |
| 32 | CFLAGS_NO= $(WFLAGS) -I.. |
| 33 | CFLAGS= $(OPT) $(CFLAGS_NO) |
| 34 | LDFLAGS= $(OPT) |
| 35 | |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 36 | RM=rm -f |
| 37 | MV=mv |
| 38 | LN=ln -s |
| 39 | |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 40 | DISTFILES= Makefile *.c *.h image |
| 41 | |
| 42 | .c.o: |
| 43 | $(CC) $(CFLAGS) -c $*.c |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 44 | ifdef BUILD_PROFILE_LIBS |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 45 | $(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 46 | endif |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 47 | # $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 48 | ifdef BUILD_DLL_SHLIBS |
| 49 | (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ |
| 50 | -o jump/$*.o -c $*.c) |
| 51 | endif |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 52 | |
| 53 | libext2fs.a: $(OBJS) |
| 54 | $(RM) $@.bak |
| 55 | -$(MV) $@ $@.bak |
| 56 | $(ARCHIVE) $@ $(OBJS) |
| 57 | $(RANLIB) $@ |
| 58 | $(RM) ../$@ |
| 59 | $(LN) ext2fs/$@ ../$@ |
| 60 | |
| 61 | libext2fs_p.a: $(OBJS) |
| 62 | $(RM) $@.bak |
| 63 | -$(MV) $@ $@.bak |
| 64 | (cd profiled; $(ARCHIVE) ../$@ $(OBJS)) |
| 65 | $(RANLIB) $@ |
| 66 | $(RM) ../$@ |
| 67 | $(LN) ext2fs/$@ ../$@ |
| 68 | |
| 69 | libext2fs_chk.a: $(OBJS) |
| 70 | $(RM) $@.bak |
| 71 | -$(MV) $@ $@.bak |
| 72 | (cd checker; $(ARCHIVE) ../$@ $(OBJS)) |
| 73 | $(RANLIB) $@ |
| 74 | $(RM) ../$@ |
| 75 | $(LN) ext2fs/$@ ../$@ |
| 76 | |
| 77 | ext2_err.c ext2_err.h: ext2_err.et |
| 78 | $(COMPILE_ET) ext2_err.et |
| 79 | |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 80 | install-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'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 85 | |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 86 | install-libs:: $(HFILES) |
| 87 | @rm -rf $(INCLDIR)/ext2fs |
| 88 | @mkdir $(INCLDIR)/ext2fs |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 89 | for i in $(HFILES); do \ |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 90 | $(INSTALLINC) $$i $(INCLDIR)/ext2fs/$$i; \ |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 91 | done |
| 92 | |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 93 | install-tree:: |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 94 | |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame^] | 95 | install:: |
| 96 | |
| 97 | clean:: |
| 98 | rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* |
| 99 | rm -f ../libext2fs.a ../libext2fs_p.a ../libext2fs_chk.a |
| 100 | |
| 101 | really-clean:: clean |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 102 | rm -f .depend ext2_err.c ext2_err.h |
| 103 | |
| 104 | dep depend .depend: ext2_err.h |
| 105 | $(CC) -M $(CFLAGS) *.c >.depend |
| 106 | |
| 107 | include .depend |