• 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@MAKEFILE_CHECKER@
61
62.c.o:
63	$(E) "	CC $<"
64	$(Q) $(CC) $(ALL_CFLAGS) -c $< -o $@
65@PROFILE_CMT@	$(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
66@CHECKER_CMT@	$(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
67@ELF_CMT@	$(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
68@BSDLIB_CMT@	$(Q) $(CC) $(ALL_CFLAGS) $(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
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) -DDEBUG -o uuid_time $(srcdir)/uuid_time.c \
90		$(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) "	MKINSTALLDIRS $(libdir) $(includedir)/uuid $(man3dir)"
134	$(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir)  \
135		$(DESTDIR)$(includedir)/uuid $(DESTDIR)$(man3dir) \
136		$(DESTDIR)$(libdir)/pkgconfig
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) $(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_random.3
154	$(E) "	LINK $(man3dir)/uuid_generate_time.3"
155	$(Q) $(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
156	$(E) "	INSTALL_DATA $(libdir)/pkgconfig/uuid.pc"
157	$(Q) $(INSTALL_DATA) uuid.pc $(DESTDIR)$(libdir)/pkgconfig/uuid.pc
158
159uninstall::
160	$(RM) -f $(DESTDIR)$(libdir)/libuuid.a \
161		$(DESTDIR)$(libdir)/pkgconfig/uuid.pc
162	for i in $(SMANPAGES); do \
163		$(RM) -f $(DESTDIR)$(man3dir)/$$i; \
164	done
165	$(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
166
167clean::
168	$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* uuid.h
169	$(RM) -f ../libuuid.a ../libuuid_p.a tst_uuid uuid_time $(SMANPAGES)
170
171check:: tst_uuid
172	LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./tst_uuid
173
174mostlyclean:: clean
175distclean:: clean
176	$(RM) -f .depend Makefile uuid.pc \
177		$(srcdir)/TAGS $(srcdir)/Makefile.in.old
178
179#
180# Hack to parallel makes recognize dependencies correctly.
181#
182../../lib/libuuid.a: libuuid.a
183../../lib/libuuid.so: image
184../../lib/libuuid.dylib: image
185
186$(OBJS): subdirs uuid.h
187
188# +++ Dependency line eater +++
189#
190# Makefile dependencies follow.  This must be the last section in
191# the Makefile.in file
192#
193clear.o: $(srcdir)/clear.c $(srcdir)/uuidP.h
194compare.o: $(srcdir)/compare.c $(srcdir)/uuidP.h
195copy.o: $(srcdir)/copy.c $(srcdir)/uuidP.h
196gen_uuid.o: $(srcdir)/gen_uuid.c $(srcdir)/uuidP.h $(srcdir)/uuidd.h
197isnull.o: $(srcdir)/isnull.c $(srcdir)/uuidP.h
198pack.o: $(srcdir)/pack.c $(srcdir)/uuidP.h
199parse.o: $(srcdir)/parse.c $(srcdir)/uuidP.h
200unpack.o: $(srcdir)/unpack.c $(srcdir)/uuidP.h
201unparse.o: $(srcdir)/unparse.c $(srcdir)/uuidP.h
202uuid_time.o: $(srcdir)/uuid_time.c $(srcdir)/uuidP.h
203