1# Makefile for the UUID library 2# 3 4srcdir = @srcdir@ 5top_srcdir = @top_srcdir@ 6VPATH = @srcdir@ 7top_builddir = ../.. 8my_dir = lib/uuid 9INSTALL = @INSTALL@ 10MKDIR_P = @MKDIR_P@ 11 12@MCONFIG@ 13 14all:: 15 16SMANPAGES= uuid.3 uuid_clear.3 uuid_compare.3 uuid_copy.3 \ 17 uuid_generate.3 uuid_is_null.3 uuid_parse.3 \ 18 uuid_time.3 uuid_unparse.3 19 20OBJS= clear.o \ 21 compare.o \ 22 copy.o \ 23 gen_uuid.o \ 24 isnull.o \ 25 pack.o \ 26 parse.o \ 27 unpack.o \ 28 unparse.o \ 29 uuid_time.o 30 31SRCS= $(srcdir)/clear.c \ 32 $(srcdir)/compare.c \ 33 $(srcdir)/copy.c \ 34 $(srcdir)/gen_uuid.c \ 35 $(srcdir)/isnull.c \ 36 $(srcdir)/pack.c \ 37 $(srcdir)/parse.c \ 38 $(srcdir)/unpack.c \ 39 $(srcdir)/unparse.c \ 40 $(srcdir)/uuid_time.c 41 42LIBRARY= libuuid 43LIBDIR= uuid 44 45ELF_VERSION = 1.2 46ELF_SO_VERSION = 1 47ELF_IMAGE = libuuid 48ELF_MYDIR = uuid 49ELF_INSTALL_DIR = $(root_libdir) 50ELF_OTHER_LIBS = 51 52BSDLIB_VERSION = 1.1 53BSDLIB_IMAGE = libuuid 54BSDLIB_MYDIR = uuid 55BSDLIB_INSTALL_DIR = $(root_libdir) 56 57@MAKEFILE_LIBRARY@ 58@MAKEFILE_ELF@ 59@MAKEFILE_BSDLIB@ 60@MAKEFILE_PROFILE@ 61 62.c.o: 63 $(E) " CC $<" 64 $(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@ 65 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< 66 $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $< 67@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $< 68@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $< 69@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(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) " MKDIR_P $(libdir) $(includedir)/uuid $(man3dir)" 135 $(Q) $(MKDIR_P) $(DESTDIR)$(libdir) \ 136 $(DESTDIR)$(includedir)/uuid $(DESTDIR)$(man3dir) \ 137 $(DESTDIR)$(pkgconfigdir) 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 $(pkgconfigdir)/uuid.pc" 160 $(Q) $(INSTALL_DATA) uuid.pc $(DESTDIR)$(pkgconfigdir)/uuid.pc 161 162uninstall:: 163 $(RM) -f $(DESTDIR)$(libdir)/libuuid.a \ 164 $(DESTDIR)$(pkgconfigdir)/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/* uuid.h \ 172 ../libuuid.a ../libuuid_p.a tst_uuid uuid_time \ 173 uuid.pc uuid_types.h $(SMANPAGES) 174 175fullcheck check:: tst_uuid 176 LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./tst_uuid 177 178mostlyclean:: clean 179distclean:: clean 180 $(RM) -f .depend Makefile uuid.pc \ 181 $(srcdir)/TAGS $(srcdir)/Makefile.in.old 182 183# 184# Hack to parallel makes recognize dependencies correctly. 185# 186../../lib/libuuid.a: libuuid.a 187../../lib/libuuid.so: image 188../../lib/libuuid.dylib: image 189 190$(OBJS): subdirs uuid.h 191 192# +++ Dependency line eater +++ 193# 194# Makefile dependencies follow. This must be the last section in 195# the Makefile.in file 196# 197clear.o: $(srcdir)/clear.c $(top_builddir)/lib/config.h \ 198 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 199compare.o: $(srcdir)/compare.c $(top_builddir)/lib/config.h \ 200 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 201copy.o: $(srcdir)/copy.c $(top_builddir)/lib/config.h \ 202 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 203gen_uuid.o: $(srcdir)/gen_uuid.c $(top_builddir)/lib/config.h \ 204 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h $(srcdir)/uuidd.h 205isnull.o: $(srcdir)/isnull.c $(top_builddir)/lib/config.h \ 206 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 207pack.o: $(srcdir)/pack.c $(top_builddir)/lib/config.h \ 208 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 209parse.o: $(srcdir)/parse.c $(top_builddir)/lib/config.h \ 210 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 211unpack.o: $(srcdir)/unpack.c $(top_builddir)/lib/config.h \ 212 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 213unparse.o: $(srcdir)/unparse.c $(top_builddir)/lib/config.h \ 214 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 215uuid_time.o: $(srcdir)/uuid_time.c $(top_builddir)/lib/config.h \ 216 $(top_builddir)/lib/dirpaths.h $(srcdir)/uuidP.h 217