1# Makefile for the UUID library 2# 3 4srcdir = @srcdir@ 5top_srcdir = @top_srcdir@ 6VPATH = @srcdir@ 7top_builddir = ../.. 8my_dir = lib/uuid 9INSTALL = @INSTALL@ 10 11@MCONFIG@ 12 13all:: 14 15SMANPAGES= uuid.3 uuid_clear.3 uuid_compare.3 uuid_copy.3 \ 16 uuid_generate.3 uuid_is_null.3 uuid_parse.3 \ 17 uuid_time.3 uuid_unparse.3 18 19OBJS= clear.o \ 20 compare.o \ 21 copy.o \ 22 gen_uuid.o \ 23 isnull.o \ 24 pack.o \ 25 parse.o \ 26 unpack.o \ 27 unparse.o \ 28 uuid_time.o 29 30SRCS= $(srcdir)/clear.c \ 31 $(srcdir)/compare.c \ 32 $(srcdir)/copy.c \ 33 $(srcdir)/gen_uuid.c \ 34 $(srcdir)/isnull.c \ 35 $(srcdir)/pack.c \ 36 $(srcdir)/parse.c \ 37 $(srcdir)/unpack.c \ 38 $(srcdir)/unparse.c \ 39 $(srcdir)/uuid_time.c 40 41LIBRARY= libuuid 42LIBDIR= uuid 43 44ELF_VERSION = 1.2 45ELF_SO_VERSION = 1 46ELF_IMAGE = libuuid 47ELF_MYDIR = uuid 48ELF_INSTALL_DIR = $(root_libdir) 49ELF_OTHER_LIBS = 50 51BSDLIB_VERSION = 1.1 52BSDLIB_IMAGE = libuuid 53BSDLIB_MYDIR = uuid 54BSDLIB_INSTALL_DIR = $(root_libdir) 55 56@MAKEFILE_LIBRARY@ 57@MAKEFILE_ELF@ 58@MAKEFILE_BSDLIB@ 59@MAKEFILE_PROFILE@ 60@MAKEFILE_CHECKER@ 61 62.c.o: 63 $(E) " CC $<" 64 $(Q) $(CC) $(ALL_CFLAGS) -c $< -o $@ 65 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< 66@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $< 67@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $< 68@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $< 69@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $< 70 71all:: tst_uuid uuid_time $(SMANPAGES) uuid.pc 72 73uuid.h: $(srcdir)/uuid.h.in 74 $(E) " CP $@" 75 $(Q) cp $(srcdir)/uuid.h.in uuid.h 76 77$(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)/config.status 78 cd $(top_builddir); CONFIG_FILES=$(my_dir)/uuid_types.h ./config.status 79 80tst_uuid.o: $(srcdir)/tst_uuid.c uuid.h 81 $(E) " CC $@" 82 $(Q) $(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o 83 84tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID) 85 $(E) " LD $@" 86 $(Q) $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(STATIC_LIBUUID) 87 88uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID) 89 $(E) " LD $@" 90 $(Q) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -DDEBUG -o uuid_time \ 91 $(srcdir)/uuid_time.c $(LIBUUID) 92 93uuid.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid.3.in 94 $(E) " SUBST $@" 95 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid.3.in uuid.3 96 97uuid_clear.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_clear.3.in 98 $(E) " SUBST $@" 99 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_clear.3.in uuid_clear.3 100 101uuid_compare.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_compare.3.in 102 $(E) " SUBST $@" 103 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_compare.3.in uuid_compare.3 104 105uuid_copy.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_copy.3.in 106 $(E) " SUBST $@" 107 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_copy.3.in uuid_copy.3 108 109uuid_generate.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_generate.3.in 110 $(E) " SUBST $@" 111 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_generate.3.in uuid_generate.3 112 113uuid_is_null.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_is_null.3.in 114 $(E) " SUBST $@" 115 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_is_null.3.in uuid_is_null.3 116 117uuid_parse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_parse.3.in 118 $(E) " SUBST $@" 119 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_parse.3.in uuid_parse.3 120 121uuid_time.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_time.3.in 122 $(E) " SUBST $@" 123 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_time.3.in uuid_time.3 124 125uuid_unparse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_unparse.3.in 126 $(E) " SUBST $@" 127 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_unparse.3.in uuid_unparse.3 128 129uuid.pc: $(srcdir)/uuid.pc.in $(top_builddir)/config.status 130 $(E) " CONFIG.STATUS $@" 131 $(Q) cd $(top_builddir); CONFIG_FILES=lib/uuid/uuid.pc ./config.status 132 133installdirs:: 134 $(E) " MKINSTALLDIRS $(libdir) $(includedir)/uuid $(man3dir)" 135 $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \ 136 $(DESTDIR)$(includedir)/uuid $(DESTDIR)$(man3dir) \ 137 $(DESTDIR)$(libdir)/pkgconfig 138 139install:: all installdirs 140 $(E) " INSTALL_DATA $(libdir)/libuuid.a" 141 $(Q) $(INSTALL_DATA) libuuid.a $(DESTDIR)$(libdir)/libuuid.a 142 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libuuid.a 143 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libuuid.a 144 $(E) " INSTALL_DATA $(includedir)/uuid/uuid.h" 145 $(Q) $(INSTALL_DATA) uuid.h $(DESTDIR)$(includedir)/uuid/uuid.h 146 $(Q) for i in $(SMANPAGES); do \ 147 $(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \ 148 echo " INSTALL_DATA $(man3dir)/$$i"; \ 149 $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \ 150 done 151 $(Q) $(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3.gz \ 152 $(DESTDIR)$(man3dir)/uuid_generate_time.3.gz 153 $(E) " LINK $(man3dir)/uuid_generate_random.3" 154 $(Q) (cd $(DESTDIR)$(man3dir); \ 155 $(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_random.3) 156 $(E) " LINK $(man3dir)/uuid_generate_time.3" 157 $(Q) (cd $(DESTDIR)$(man3dir); \ 158 $(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_time.3) 159 $(E) " INSTALL_DATA $(libdir)/pkgconfig/uuid.pc" 160 $(Q) $(INSTALL_DATA) uuid.pc $(DESTDIR)$(libdir)/pkgconfig/uuid.pc 161 162uninstall:: 163 $(RM) -f $(DESTDIR)$(libdir)/libuuid.a \ 164 $(DESTDIR)$(libdir)/pkgconfig/uuid.pc 165 for i in $(SMANPAGES); do \ 166 $(RM) -f $(DESTDIR)$(man3dir)/$$i; \ 167 done 168 $(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3 169 170clean:: 171 $(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* uuid.h 172 $(RM) -f ../libuuid.a ../libuuid_p.a tst_uuid uuid_time $(SMANPAGES) 173 174check:: tst_uuid 175 LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./tst_uuid 176 177mostlyclean:: clean 178distclean:: clean 179 $(RM) -f .depend Makefile uuid.pc \ 180 $(srcdir)/TAGS $(srcdir)/Makefile.in.old 181 182# 183# Hack to parallel makes recognize dependencies correctly. 184# 185../../lib/libuuid.a: libuuid.a 186../../lib/libuuid.so: image 187../../lib/libuuid.dylib: image 188 189$(OBJS): subdirs uuid.h 190 191# +++ Dependency line eater +++ 192# 193# Makefile dependencies follow. This must be the last section in 194# the Makefile.in file 195# 196clear.o: $(srcdir)/clear.c $(top_builddir)/lib/config.h \ 197 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 198compare.o: $(srcdir)/compare.c $(top_builddir)/lib/config.h \ 199 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 200copy.o: $(srcdir)/copy.c $(top_builddir)/lib/config.h \ 201 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 202gen_uuid.o: $(srcdir)/gen_uuid.c $(top_builddir)/lib/config.h \ 203 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h $(srcdir)/uuidd.h 204isnull.o: $(srcdir)/isnull.c $(top_builddir)/lib/config.h \ 205 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 206pack.o: $(srcdir)/pack.c $(top_builddir)/lib/config.h \ 207 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 208parse.o: $(srcdir)/parse.c $(top_builddir)/lib/config.h \ 209 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 210unpack.o: $(srcdir)/unpack.c $(top_builddir)/lib/config.h \ 211 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 212unparse.o: $(srcdir)/unparse.c $(top_builddir)/lib/config.h \ 213 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 214uuid_time.o: $(srcdir)/uuid_time.c $(top_builddir)/lib/config.h \ 215 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 216