• 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	@echo "	CC $<"
64	@$(CC) $(ALL_CFLAGS) -c $< -o $@
65@PROFILE_CMT@	@$(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
66@CHECKER_CMT@	@$(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
67@ELF_CMT@	@$(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
68@BSDLIB_CMT@	@$(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
69
70all:: tst_uuid uuid_time $(SMANPAGES) uuid.pc
71
72$(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)/config.status
73	cd $(top_builddir); CONFIG_FILES=$(my_dir)/uuid_types.h ./config.status
74
75tst_uuid.o: $(srcdir)/tst_uuid.c
76	@echo "	CC $@"
77	@$(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o
78
79tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID)
80	@echo "	LD $@"
81	@$(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(STATIC_LIBUUID)
82
83uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
84	@echo "	LD $@"
85	@$(CC) $(ALL_CFLAGS) -DDEBUG -o uuid_time $(srcdir)/uuid_time.c \
86		$(LIBUUID)
87
88uuid.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid.3.in
89	@echo "	SUBST $@"
90	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid.3.in uuid.3
91
92uuid_clear.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_clear.3.in
93	@echo "	SUBST $@"
94	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_clear.3.in uuid_clear.3
95
96uuid_compare.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_compare.3.in
97	@echo "	SUBST $@"
98	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_compare.3.in uuid_compare.3
99
100uuid_copy.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_copy.3.in
101	@echo "	SUBST $@"
102	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_copy.3.in uuid_copy.3
103
104uuid_generate.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_generate.3.in
105	@echo "	SUBST $@"
106	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_generate.3.in uuid_generate.3
107
108uuid_is_null.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_is_null.3.in
109	@echo "	SUBST $@"
110	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_is_null.3.in uuid_is_null.3
111
112uuid_parse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_parse.3.in
113	@echo "	SUBST $@"
114	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_parse.3.in uuid_parse.3
115
116uuid_time.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_time.3.in
117	@echo "	SUBST $@"
118	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_time.3.in uuid_time.3
119
120uuid_unparse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_unparse.3.in
121	@echo "	SUBST $@"
122	@$(SUBSTITUTE_UPTIME) $(srcdir)/uuid_unparse.3.in uuid_unparse.3
123
124uuid.pc: $(srcdir)/uuid.pc.in $(top_builddir)/config.status
125	@echo "	CONFIG.STATUS $@"
126	@cd $(top_builddir); CONFIG_FILES=lib/uuid/uuid.pc ./config.status
127
128installdirs::
129	@echo "	MKINSTALLDIRS $(libdir) $(includedir)/uuid $(man3dir)"
130	@$(MKINSTALLDIRS) $(DESTDIR)$(libdir)  \
131		$(DESTDIR)$(includedir)/uuid $(DESTDIR)$(man3dir) \
132		$(DESTDIR)$(libdir)/pkgconfig
133
134install:: all installdirs
135	@echo "	INSTALL_DATA $(libdir)/libuuid.a"
136	@$(INSTALL_DATA) libuuid.a $(DESTDIR)$(libdir)/libuuid.a
137	@-$(RANLIB) $(DESTDIR)$(libdir)/libuuid.a
138	@$(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libuuid.a
139	@echo "	INSTALL_DATA $(includedir)/uuid/uuid.h"
140	@$(INSTALL_DATA) $(srcdir)/uuid.h $(DESTDIR)$(includedir)/uuid/uuid.h
141	@for i in $(SMANPAGES); do \
142		$(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \
143		echo "	INSTALL_DATA $(man3dir)/$$i"; \
144		$(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \
145	done
146	@$(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3.gz \
147		$(DESTDIR)$(man3dir)/uuid_generate_time.3.gz
148	@echo "	LINK $(man3dir)/uuid_generate_random.3"
149	@$(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_random.3
150	@echo "	LINK $(man3dir)/uuid_generate_time.3"
151	@$(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
152	@echo "	INSTALL_DATA $(libdir)/pkgconfig/uuid.pc"
153	@$(INSTALL_DATA) uuid.pc $(DESTDIR)$(libdir)/pkgconfig/uuid.pc
154
155uninstall::
156	$(RM) -f $(DESTDIR)$(libdir)/libuuid.a \
157		$(DESTDIR)$(libdir)/pkgconfig/uuid.pc
158	for i in $(SMANPAGES); do \
159		$(RM) -f $(DESTDIR)$(man3dir)/$$i; \
160	done
161	$(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
162
163clean::
164	$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
165	$(RM) -f ../libuuid.a ../libuuid_p.a tst_uuid uuid_time $(SMANPAGES)
166
167check:: tst_uuid
168	LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./tst_uuid
169
170mostlyclean:: clean
171distclean:: clean
172	$(RM) -f .depend Makefile uuid.pc \
173		$(srcdir)/TAGS $(srcdir)/Makefile.in.old
174
175#
176# Hack to parallel makes recognize dependencies correctly.
177#
178../../lib/libuuid.a: libuuid.a
179../../lib/libuuid.so: image
180../../lib/libuuid.dylib: image
181
182$(OBJS): subdirs
183
184# +++ Dependency line eater +++
185#
186# Makefile dependencies follow.  This must be the last section in
187# the Makefile.in file
188#
189clear.o: $(srcdir)/clear.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
190compare.o: $(srcdir)/compare.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
191copy.o: $(srcdir)/copy.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
192gen_uuid.o: $(srcdir)/gen_uuid.c $(srcdir)/uuidP.h $(srcdir)/uuid.h \
193 $(srcdir)/uuidd.h
194isnull.o: $(srcdir)/isnull.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
195pack.o: $(srcdir)/pack.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
196parse.o: $(srcdir)/parse.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
197unpack.o: $(srcdir)/unpack.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
198unparse.o: $(srcdir)/unparse.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
199uuid_time.o: $(srcdir)/uuid_time.c $(srcdir)/uuidP.h $(srcdir)/uuid.h
200