• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
61.c.o:
62	$(E) "	CC $<"
63	$(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@
64	$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
65	$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
66@PROFILE_CMT@	$(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $<
67@ELF_CMT@	$(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $<
68@BSDLIB_CMT@	$(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
69
70all:: tst_uuid uuid_time $(SMANPAGES) uuid.pc
71
72uuid.h: $(srcdir)/uuid.h.in
73	$(E) "	CP $@"
74	$(Q) cp $(srcdir)/uuid.h.in uuid.h
75
76$(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)/config.status
77	cd $(top_builddir); CONFIG_FILES=$(my_dir)/uuid_types.h ./config.status
78
79tst_uuid.o: $(srcdir)/tst_uuid.c uuid.h
80	$(E) "	CC $@"
81	$(Q) $(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o
82
83tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID)
84	$(E) "	LD $@"
85	$(Q) $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(STATIC_LIBUUID)
86
87uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
88	$(E) "	LD $@"
89	$(Q) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -DDEBUG -o uuid_time \
90		$(srcdir)/uuid_time.c $(LIBUUID)
91
92uuid.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid.3.in
93	$(E) "	SUBST $@"
94	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid.3.in uuid.3
95
96uuid_clear.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_clear.3.in
97	$(E) "	SUBST $@"
98	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_clear.3.in uuid_clear.3
99
100uuid_compare.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_compare.3.in
101	$(E) "	SUBST $@"
102	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_compare.3.in uuid_compare.3
103
104uuid_copy.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_copy.3.in
105	$(E) "	SUBST $@"
106	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_copy.3.in uuid_copy.3
107
108uuid_generate.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_generate.3.in
109	$(E) "	SUBST $@"
110	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_generate.3.in uuid_generate.3
111
112uuid_is_null.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_is_null.3.in
113	$(E) "	SUBST $@"
114	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_is_null.3.in uuid_is_null.3
115
116uuid_parse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_parse.3.in
117	$(E) "	SUBST $@"
118	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_parse.3.in uuid_parse.3
119
120uuid_time.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_time.3.in
121	$(E) "	SUBST $@"
122	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_time.3.in uuid_time.3
123
124uuid_unparse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_unparse.3.in
125	$(E) "	SUBST $@"
126	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_unparse.3.in uuid_unparse.3
127
128uuid.pc: $(srcdir)/uuid.pc.in $(top_builddir)/config.status
129	$(E) "	CONFIG.STATUS $@"
130	$(Q) cd $(top_builddir); CONFIG_FILES=lib/uuid/uuid.pc ./config.status
131
132installdirs::
133	$(E) "	MKDIR_P $(libdir) $(includedir)/uuid $(man3dir)"
134	$(Q) $(MKDIR_P) $(DESTDIR)$(libdir)  \
135		$(DESTDIR)$(includedir)/uuid $(DESTDIR)$(man3dir) \
136		$(DESTDIR)$(pkgconfigdir)
137
138install:: all installdirs
139	$(E) "	INSTALL_DATA $(libdir)/libuuid.a"
140	$(Q) $(INSTALL_DATA) libuuid.a $(DESTDIR)$(libdir)/libuuid.a
141	-$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libuuid.a
142	$(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libuuid.a
143	$(E) "	INSTALL_DATA $(includedir)/uuid/uuid.h"
144	$(Q) $(INSTALL_DATA) uuid.h $(DESTDIR)$(includedir)/uuid/uuid.h
145	$(Q) for i in $(SMANPAGES); do \
146		$(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \
147		echo "	INSTALL_DATA $(man3dir)/$$i"; \
148		$(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \
149	done
150	$(Q) $(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3.gz \
151		$(DESTDIR)$(man3dir)/uuid_generate_time.3.gz
152	$(E) "	LINK $(man3dir)/uuid_generate_random.3"
153	$(Q) (cd $(DESTDIR)$(man3dir); \
154	    $(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_random.3)
155	$(E) "	LINK $(man3dir)/uuid_generate_time.3"
156	$(Q) (cd $(DESTDIR)$(man3dir); \
157	    $(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_time.3)
158	$(E) "	INSTALL_DATA $(pkgconfigdir)/uuid.pc"
159	$(Q) $(INSTALL_DATA) uuid.pc $(DESTDIR)$(pkgconfigdir)/uuid.pc
160
161uninstall::
162	$(RM) -f $(DESTDIR)$(libdir)/libuuid.a \
163		$(DESTDIR)$(pkgconfigdir)/uuid.pc
164	for i in $(SMANPAGES); do \
165		$(RM) -f $(DESTDIR)$(man3dir)/$$i; \
166	done
167	$(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
168
169clean::
170	$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* uuid.h \
171		../libuuid.a ../libuuid_p.a tst_uuid uuid_time \
172		uuid.pc uuid_types.h $(SMANPAGES)
173
174fullcheck check:: 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