1# Makefile for libblkid 2# 3# Copyright (C) 2001 Theodore Ts'o (tytso@mit.edu) 4# 5# This file can be redistributed under the terms of the 6# GNU Lesser General Public License 7 8srcdir = @srcdir@ 9top_srcdir = @top_srcdir@ 10VPATH = @srcdir@ 11top_builddir = ../.. 12my_dir = lib/blkid 13INSTALL = @INSTALL@ 14 15@MCONFIG@ 16 17all:: 18 19SMANPAGES= libblkid.3 20 21OBJS= cache.o dev.o devname.o devno.o getsize.o llseek.o probe.o \ 22 read.o resolve.o save.o tag.o version.o 23 24SRCS= $(srcdir)/cache.c $(srcdir)/dev.c $(srcdir)/devname.c $(srcdir)/devno.c \ 25 $(srcdir)/getsize.c $(srcdir)/llseek.c $(srcdir)/probe.c \ 26 $(srcdir)/read.c $(srcdir)/resolve.c $(srcdir)/save.c $(srcdir)/tag.c \ 27 $(srcdir)/version.c 28 29HFILES_IN= blkid.h blkid_types.h 30 31LIBRARY= libblkid 32LIBDIR= blkid 33 34ELF_VERSION = 1.0 35ELF_SO_VERSION = 1 36ELF_IMAGE = libblkid 37ELF_MYDIR = blkid 38ELF_INSTALL_DIR = $(root_libdir) 39ELF_OTHER_LIBS = -luuid 40 41BSDLIB_VERSION = 2.0 42BSDLIB_IMAGE = libblkid 43BSDLIB_MYDIR = blkid 44BSDLIB_INSTALL_DIR = $(root_libdir) 45 46@MAKEFILE_LIBRARY@ 47@MAKEFILE_ELF@ 48@MAKEFILE_BSDLIB@ 49@MAKEFILE_PROFILE@ 50 51LIBS_BLKID= $(STATIC_LIBBLKID) $(STATIC_LIBUUID) 52DEPLIBS_BLKID= $(DEPSTATIC_LIBBLKID) $(DEPSTATIC_LIBUUID) 53 54.c.o: 55 $(E) " CC $<" 56 $(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@ 57 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< 58 $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $< 59@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $< 60@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $< 61@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $< 62 63all:: $(SMANPAGES) blkid.pc 64 65blkid_types.h: $(srcdir)/blkid_types.h.in $(top_builddir)/config.status 66 $(E) " CONFIG.STATUS $@" 67 $(Q) cd $(top_builddir); \ 68 CONFIG_FILES=$(my_dir)/blkid_types.h ./config.status 69 70blkid.h: $(srcdir)/blkid.h.in 71 $(E) " CP $@" 72 $(Q) cp $(srcdir)/blkid.h.in blkid.h 73 74libblkid.3: $(DEP_SUBSTITUTE) $(srcdir)/libblkid.3.in 75 $(E) " SUBST $@" 76 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/libblkid.3.in libblkid.3 77 78tst_cache: $(srcdir)/cache.c $(DEPLIBS_BLKID) 79 $(E) " LD $@" 80 $(Q) $(CC) -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(ALL_CFLAGS) 81 82tst_dev: $(srcdir)/dev.c $(DEPLIBS_BLKID) 83 $(E) " LD $@" 84 $(Q) $(CC) -o tst_dev -DTEST_PROGRAM $(srcdir)/dev.c $(LIBS_BLKID) $(ALL_CFLAGS) 85 86tst_devname: $(srcdir)/devname.c $(DEPLIBS_BLKID) 87 $(E) " LD $@" 88 $(Q) $(CC) -o tst_devname -DTEST_PROGRAM $(srcdir)/devname.c $(LIBS_BLKID) $(ALL_CFLAGS) 89 90tst_devno: $(srcdir)/devno.c $(DEPLIBS_BLKID) 91 $(E) " LD $@" 92 $(Q) $(CC) -o tst_devno -DTEST_PROGRAM $(srcdir)/devno.c $(LIBS_BLKID) $(ALL_CFLAGS) 93 94tst_getsize: $(srcdir)/getsize.c $(DEPLIBS_BLKID) 95 $(E) " LD $@" 96 $(Q) $(CC) -o tst_getsize -DTEST_PROGRAM $(srcdir)/getsize.c $(LIBS_BLKID) $(ALL_CFLAGS) 97 98tst_probe: $(srcdir)/probe.c $(DEPLIBS_BLKID) 99 $(E) " LD $@" 100 $(Q) $(CC) -o tst_probe -DTEST_PROGRAM $(srcdir)/probe.c $(LIBS_BLKID) $(ALL_CFLAGS) 101 102tst_read: $(srcdir)/read.c $(DEPLIBS_BLKID) 103 $(E) " LD $@" 104 $(Q) $(CC) -o tst_read -DTEST_PROGRAM $(srcdir)/read.c $(LIBS_BLKID) $(ALL_CFLAGS) 105 106tst_resolve: $(srcdir)/resolve.c $(DEPLIBS_BLKID) 107 $(E) " LD $@" 108 $(Q) $(CC) -o tst_resolve -DTEST_PROGRAM $(srcdir)/resolve.c $(LIBS_BLKID) $(ALL_CFLAGS) 109 110tst_save: $(srcdir)/save.c $(DEPLIBS_BLKID) 111 $(E) " LD $@" 112 $(Q) $(CC) -o tst_save -DTEST_PROGRAM $(srcdir)/save.c $(LIBS_BLKID) $(ALL_CFLAGS) 113 114tst_tag: $(srcdir)/tag.c $(DEPLIBS_BLKID) 115 $(E) " LD $@" 116 $(Q) $(CC) -o tst_tag -DTEST_PROGRAM $(srcdir)/tag.c $(LIBS_BLKID) $(ALL_CFLAGS) 117 118tst_types: tst_types.o blkid_types.h 119 $(E) " LD $@" 120 $(Q) $(CC) -o tst_types $(ALL_LDFLAGS) tst_types.o 121 122../../misc/blkid.o: $(top_srcdir)/misc/blkid.c blkid.h 123 $(E) " CC $@" 124 $(Q) $(CC) $(ALL_CFLAGS) -c $(top_srcdir)/misc/blkid.c \ 125 -o ../../misc/blkid.o 126 127blkid: ../../misc/blkid.o libblkid.a $(DEPLIBUUID) 128 $(E) " LD $@" 129 $(Q) $(CC) -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID) 130 131test_probe: test_probe.in Makefile 132 $(E) "Creating test_probe..." 133 $(E) "#!/bin/sh" > test_probe 134 $(E) "SRCDIR=@srcdir@" >> test_probe 135 $(Q) cat $(srcdir)/test_probe.in >> test_probe 136 $(Q) chmod +x test_probe 137 138check:: all tst_cache tst_dev tst_devname tst_devno tst_getsize tst_probe \ 139 tst_read tst_resolve tst_save tst_tag test_probe tst_types 140 ./test_probe 141 ./tst_types 142 143blkid.pc: $(srcdir)/blkid.pc.in $(top_builddir)/config.status 144 $(E) " CONFIG.STATUS $@" 145 $(Q) cd $(top_builddir); CONFIG_FILES=lib/blkid/blkid.pc ./config.status 146 147installdirs:: 148 $(E) " MKINSTALLDIRS $(libdir) $(includedir)/blkid" 149 $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \ 150 $(DESTDIR)$(includedir)/blkid $(DESTDIR)$(pkgconfigdir) 151 152install:: all installdirs 153 $(E) " INSTALL_DATA $(libdir)/libblkid.a" 154 $(Q) $(INSTALL_DATA) libblkid.a $(DESTDIR)$(libdir)/libblkid.a 155 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libblkid.a 156 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libblkid.a 157 $(Q) set -e; for i in $(HFILES_IN); do \ 158 echo " INSTALL_DATA $(includedir)/blkid/$$i"; \ 159 $(INSTALL_DATA) $$i $(DESTDIR)$(includedir)/blkid/$$i; \ 160 done 161 $(Q) for i in $(SMANPAGES); do \ 162 echo " INSTALL_DATA $(man3dir)/$$i"; \ 163 $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \ 164 done 165 $(E) " INSTALL_DATA $(pkgconfigdir)/blkid.pc" 166 $(Q) $(INSTALL_DATA) blkid.pc $(DESTDIR)$(pkgconfigdir)/blkid.pc 167 168uninstall:: 169 $(RM) -f $(DESTDIR)$(libdir)/libblkid.a \ 170 $(DESTDIR)$(pkgconfigdir)/blkid.pc 171 $(RM) -rf $(DESTDIR)$(includedir)/blkid 172 for i in $(SMANPAGES); do \ 173 $(RM) -f $(DESTDIR)$(man3dir)/$$i; \ 174 done 175 176clean:: 177 $(RM) -f \#* *.s *.o *.orig *.a *~ *.bak tst_cache tst_dev tst_devname \ 178 tst_devno tst_getsize tst_probe tst_read tst_resolve tst_save \ 179 tst_tag tst_types tests/*.out tests/*.ok \ 180 tests/*.img results test_probe core profiled/* \ 181 blkid.h blkid_types.h ../libblkid.a ../libblkid_p.a \ 182 $(SMANPAGES) blkid blkid.pc 183 @echo rmdir tests/tmp tests 184 @(rmdir tests/tmp tests 2> /dev/null ; exit 0) 185 186mostlyclean:: clean 187distclean:: clean 188 $(RM) -f .depend Makefile blkid.pc \ 189 $(srcdir)/TAGS $(srcdir)/Makefile.in.old 190 191$(OBJS): subdirs $(HFILES_IN) 192 193# +++ Dependency line eater +++ 194# 195# Makefile dependencies follow. This must be the last section in 196# the Makefile.in file 197# 198cache.o: $(srcdir)/cache.c $(top_builddir)/lib/config.h \ 199 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 200dev.o: $(srcdir)/dev.c $(top_builddir)/lib/config.h \ 201 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 202devname.o: $(srcdir)/devname.c $(top_builddir)/lib/config.h \ 203 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 204devno.o: $(srcdir)/devno.c $(top_builddir)/lib/config.h \ 205 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 206getsize.o: $(srcdir)/getsize.c $(top_builddir)/lib/config.h \ 207 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 208llseek.o: $(srcdir)/llseek.c $(top_builddir)/lib/config.h \ 209 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 210probe.o: $(srcdir)/probe.c $(top_builddir)/lib/config.h \ 211 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h \ 212 $(srcdir)/probe.h 213read.o: $(srcdir)/read.c $(top_builddir)/lib/config.h \ 214 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 215resolve.o: $(srcdir)/resolve.c $(top_builddir)/lib/config.h \ 216 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 217save.o: $(srcdir)/save.c $(top_builddir)/lib/config.h \ 218 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 219tag.o: $(srcdir)/tag.c $(top_builddir)/lib/config.h \ 220 $(top_builddir)/lib/dirpaths.h $(srcdir)/blkidP.h $(srcdir)/list.h 221version.o: $(srcdir)/version.c $(top_builddir)/lib/config.h \ 222 $(top_builddir)/lib/dirpaths.h $(top_srcdir)/version.h 223