Makefile revision 133277
1119166Smtm# $FreeBSD: head/lib/libarchive/Makefile 133277 2004-08-07 19:22:50Z kientzle $
2119166Smtm
3119166Smtm#
4119166Smtm# Use "make distfile" to build a conventional tar.gz archive
5119166Smtm# complete with autoconf/automake-generated build system.
6119166Smtm#
7119166Smtm
8119166Smtm
9119166SmtmLIB=	archive
10119166SmtmVERSION=	1.01.010
11119166SmtmARCHIVE_API_FEATURE=	2
12119166SmtmARCHIVE_API_VERSION=	1
13119166SmtmSHLIB_MAJOR=	${ARCHIVE_API_VERSION}
14119166SmtmCFLAGS+=	-DPACKAGE_NAME=\"lib${LIB}\"
15119166SmtmCFLAGS+=	-DPACKAGE_VERSION=\"${VERSION}\"
16119166SmtmCFLAGS+=	-I${.OBJDIR}
17119166Smtm
18119166Smtm.if ${MACHINE_ARCH} == "arm"
19119166SmtmWARNS?= 3
20119166Smtm.else
21119166SmtmWARNS?=	6
22119166Smtm.endif
23119166Smtm
24119166Smtm# I'm not yet ready for a shared version of this library, as
25119166Smtm# there are a couple of API changes still in the works.
26119166SmtmNOPIC=	1
27119166Smtm
28119166SmtmINCS=	archive.h archive_entry.h
29119166Smtm
30119166SmtmSRCS=	archive_check_magic.c				\
31120463Sphk	archive_entry.c					\
32119166Smtm	archive_read.c					\
33119166Smtm	archive_read_data_into_buffer.c			\
34119166Smtm	archive_read_data_into_fd.c			\
35119166Smtm	archive_read_extract.c				\
36119166Smtm	archive_read_open_fd.c				\
37119166Smtm	archive_read_open_file.c			\
38119166Smtm	archive_read_support_compression_all.c		\
39119166Smtm	archive_read_support_compression_bzip2.c	\
40119166Smtm	archive_read_support_compression_compress.c	\
41119166Smtm	archive_read_support_compression_gzip.c		\
42119166Smtm	archive_read_support_compression_none.c		\
43119166Smtm	archive_read_support_format_all.c		\
44119166Smtm	archive_read_support_format_cpio.c		\
45119166Smtm	archive_read_support_format_tar.c		\
46119166Smtm	archive_string.c				\
47119166Smtm	archive_string_sprintf.c			\
48119166Smtm	archive_util.c					\
49119166Smtm	archive_write.c					\
50119166Smtm	archive_write_open_fd.c				\
51119166Smtm	archive_write_open_file.c			\
52119166Smtm	archive_write_set_compression_bzip2.c		\
53119166Smtm	archive_write_set_compression_gzip.c		\
54119166Smtm	archive_write_set_compression_none.c		\
55124843Scperciva	archive_write_set_format.c			\
56119166Smtm	archive_write_set_format_by_name.c		\
57119166Smtm	archive_write_set_format_cpio.c			\
58119166Smtm	archive_write_set_format_pax.c			\
59119166Smtm	archive_write_set_format_shar.c			\
60119166Smtm	archive_write_set_format_ustar.c
61119166Smtm
62119166SmtmMAN=	archive_entry.3					\
63119166Smtm	archive_read.3					\
64119166Smtm	archive_util.3					\
65119166Smtm	archive_write.3					\
66119166Smtm	libarchive.3					\
67	libarchive-formats.5				\
68	tar.5
69
70MLINKS+=	archive_entry.3 archive_entry_acl_add_entry.3
71MLINKS+=	archive_entry.3 archive_entry_acl_add_entry_w.3
72MLINKS+=	archive_entry.3 archive_entry_acl_clear.3
73MLINKS+=	archive_entry.3 archive_entry_acl_count.3
74MLINKS+=	archive_entry.3 archive_entry_acl_next.3
75MLINKS+=	archive_entry.3 archive_entry_acl_next_w.3
76MLINKS+=	archive_entry.3 archive_entry_acl_reset.3
77MLINKS+=	archive_entry.3 archive_entry_acl_text_w.3
78MLINKS+=	archive_entry.3 archive_entry_clear.3
79MLINKS+=	archive_entry.3 archive_entry_clone.3
80MLINKS+=	archive_entry.3 archive_entry_copy_fflags_text_w.3
81MLINKS+=	archive_entry.3 archive_entry_copy_gname_w.3
82MLINKS+=	archive_entry.3 archive_entry_copy_hardlink_w.3
83MLINKS+=	archive_entry.3 archive_entry_copy_pathname_w.3
84MLINKS+=	archive_entry.3 archive_entry_copy_stat.3
85MLINKS+=	archive_entry.3 archive_entry_copy_symlink_w.3
86MLINKS+=	archive_entry.3 archive_entry_copy_uname_w.3
87MLINKS+=	archive_entry.3 archive_entry_fflags.3
88MLINKS+=	archive_entry.3 archive_entry_fflags_text.3
89MLINKS+=	archive_entry.3 archive_entry_free.3
90MLINKS+=	archive_entry.3 archive_entry_gid.3
91MLINKS+=	archive_entry.3 archive_entry_gname.3
92MLINKS+=	archive_entry.3 archive_entry_gname_w.3
93MLINKS+=	archive_entry.3 archive_entry_hardlink.3
94MLINKS+=	archive_entry.3 archive_entry_ino.3
95MLINKS+=	archive_entry.3 archive_entry_mode.3
96MLINKS+=	archive_entry.3 archive_entry_mtime.3
97MLINKS+=	archive_entry.3 archive_entry_mtime_nsec.3
98MLINKS+=	archive_entry.3 archive_entry_new.3
99MLINKS+=	archive_entry.3 archive_entry_pathname.3
100MLINKS+=	archive_entry.3 archive_entry_pathname_w.3
101MLINKS+=	archive_entry.3 archive_entry_rdev.3
102MLINKS+=	archive_entry.3 archive_entry_rdevmajor.3
103MLINKS+=	archive_entry.3 archive_entry_rdevminor.3
104MLINKS+=	archive_entry.3 archive_entry_set_fflags.3
105MLINKS+=	archive_entry.3 archive_entry_set_gid.3
106MLINKS+=	archive_entry.3 archive_entry_set_gname.3
107MLINKS+=	archive_entry.3 archive_entry_set_hardlink.3
108MLINKS+=	archive_entry.3 archive_entry_set_link.3
109MLINKS+=	archive_entry.3 archive_entry_set_mode.3
110MLINKS+=	archive_entry.3 archive_entry_set_pathname.3
111MLINKS+=	archive_entry.3 archive_entry_set_rdevmajor.3
112MLINKS+=	archive_entry.3 archive_entry_set_rdevminor.3
113MLINKS+=	archive_entry.3 archive_entry_set_size.3
114MLINKS+=	archive_entry.3 archive_entry_set_symlink.3
115MLINKS+=	archive_entry.3 archive_entry_set_uid.3
116MLINKS+=	archive_entry.3 archive_entry_set_uname.3
117MLINKS+=	archive_entry.3 archive_entry_size.3
118MLINKS+=	archive_entry.3 archive_entry_stat.3
119MLINKS+=	archive_entry.3 archive_entry_symlink.3
120MLINKS+=	archive_entry.3 archive_entry_uid.3
121MLINKS+=	archive_entry.3 archive_entry_uname.3
122MLINKS+=	archive_entry.3 archive_entry_uname_w.3
123MLINKS+=	archive_read.3 archive_read_data.3
124MLINKS+=	archive_read.3 archive_read_data_block.3
125MLINKS+=	archive_read.3 archive_read_data_into_buffer.3
126MLINKS+=	archive_read.3 archive_read_data_into_fd.3
127MLINKS+=	archive_read.3 archive_read_data_skip.3
128MLINKS+=	archive_read.3 archive_read_extract.3
129MLINKS+=	archive_read.3 archive_read_extract_set_progress_callback.3
130MLINKS+=	archive_read.3 archive_read_finish.3
131MLINKS+=	archive_read.3 archive_read_new.3
132MLINKS+=	archive_read.3 archive_read_next_header.3
133MLINKS+=	archive_read.3 archive_read_open.3
134MLINKS+=	archive_read.3 archive_read_open_fd.3
135MLINKS+=	archive_read.3 archive_read_open_file.3
136MLINKS+=	archive_read.3 archive_read_set_bytes_per_block.3
137MLINKS+=	archive_read.3 archive_read_support_compression_all.3
138MLINKS+=	archive_read.3 archive_read_support_compression_bzip2.3
139MLINKS+=	archive_read.3 archive_read_support_compression_compress.3
140MLINKS+=	archive_read.3 archive_read_support_compression_gzip.3
141MLINKS+=	archive_read.3 archive_read_support_compression_none.3
142MLINKS+=	archive_read.3 archive_read_support_format_all.3
143MLINKS+=	archive_read.3 archive_read_support_format_cpio.3
144MLINKS+=	archive_read.3 archive_read_support_format_tar.3
145MLINKS+=	archive_util.3 archive_compression.3
146MLINKS+=	archive_util.3 archive_compression_name.3
147MLINKS+=	archive_util.3 archive_errno.3
148MLINKS+=	archive_util.3 archive_error_string.3
149MLINKS+=	archive_util.3 archive_format.3
150MLINKS+=	archive_util.3 archive_format_name.3
151MLINKS+=	archive_write.3 archive_write_data.3
152MLINKS+=	archive_write.3 archive_write_finish.3
153MLINKS+=	archive_write.3 archive_write_header.3
154MLINKS+=	archive_write.3 archive_write_new.3
155MLINKS+=	archive_write.3 archive_write_open.3
156MLINKS+=	archive_write.3 archive_write_open_fd.3
157MLINKS+=	archive_write.3 archive_write_open_file.3
158MLINKS+=	archive_write.3 archive_write_prepare.3
159MLINKS+=	archive_write.3 archive_write_set_bytes_per_block.3
160MLINKS+=	archive_write.3 archive_write_set_bytes_in_last_block.3
161MLINKS+=	archive_write.3 archive_write_set_callbacks.3
162MLINKS+=	archive_write.3 archive_write_set_compression_bzip2.3
163MLINKS+=	archive_write.3 archive_write_set_compression_gzip.3
164MLINKS+=	archive_write.3 archive_write_set_format_pax.3
165MLINKS+=	archive_write.3 archive_write_set_format_shar.3
166MLINKS+=	archive_write.3 archive_write_set_format_ustar.3
167MLINKS+=	libarchive.3 archive.3
168
169#
170# archive.h is built dynamically, which has a number of implications...
171#
172
173# Ensure archive.h gets built before we compute dependencies.
174beforedepend: archive.h
175afterdepend:
176	echo "archive.h: Makefile" >> ${DEPENDFILE}
177# Ensure archive.h gets built before we compile anything.
178${SRCS:S/.c$/.o/}: archive.h
179
180# archive.h needs to be cleaned
181CLEANFILES+=	archive.h
182
183# Build archive.h from archive.h.in
184archive.h:	archive.h.in Makefile
185	cat ${.CURDIR}/archive.h.in |					\
186		sed 's/@ARCHIVE_API_VERSION@/${ARCHIVE_API_VERSION}/' |	\
187		sed 's/@ARCHIVE_API_FEATURE@/${ARCHIVE_API_FEATURE}/' |	\
188		cat > archive.h
189
190# Files that just get copied to the distfile build directory
191DIST_WORK_DIR=	${.OBJDIR}/lib${LIB}-${VERSION}
192DISTFILE=	lib${LIB}-${VERSION}.tar.gz
193DIST_FILES=	${SRCS}
194DIST_FILES+=	${MAN}
195DIST_FILES+=	archive.h.in
196DIST_FILES+=	archive_entry.h archive_platform.h
197DIST_FILES+=	archive_private.h archive_string.h
198DIST_FILES+=	Makefile.am
199
200CLEANDIRS+=	${DIST_WORK_DIR}
201
202distfile:
203	rm -rf ${DIST_WORK_DIR}
204	mkdir ${DIST_WORK_DIR}
205	for f in ${DIST_FILES};					\
206	do							\
207		cat ${.CURDIR}/$$f >${DIST_WORK_DIR}/$$f;	\
208	done
209	cat ${.CURDIR}/configure.ac.in |			\
210		sed 's/@VERSION@/${VERSION}/' |			\
211		cat > ${DIST_WORK_DIR}/configure.ac
212	(cd ${DIST_WORK_DIR} && aclocal && autoheader && autoconf && automake -a --foreign)
213	(cd ${DIST_WORK_DIR} && ./configure && make distcheck && make dist)
214	mv ${DIST_WORK_DIR}/${DISTFILE} ${.OBJDIR}
215	@echo ==================================================
216	@echo Created ${.OBJDIR}/${DISTFILE}
217	@echo ==================================================
218
219.include <bsd.lib.mk>
220