Makefile revision 149964
10Sstevel@tonic-gate# $FreeBSD: head/lib/libarchive/Makefile 149964 2005-09-10 22:58:06Z kientzle $
20Sstevel@tonic-gate
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# Use "make distfile" to build a conventional tar.gz archive
50Sstevel@tonic-gate# complete with autoconf/automake-generated build system.
60Sstevel@tonic-gate#
70Sstevel@tonic-gate
80Sstevel@tonic-gate
90Sstevel@tonic-gateLIB=	archive
100Sstevel@tonic-gateVERSION=	1.02.032
110Sstevel@tonic-gateARCHIVE_API_FEATURE=	2
120Sstevel@tonic-gateARCHIVE_API_VERSION=	2
130Sstevel@tonic-gateSHLIB_MAJOR=	${ARCHIVE_API_VERSION}
140Sstevel@tonic-gateCFLAGS+=	-DPACKAGE_NAME=\"lib${LIB}\"
150Sstevel@tonic-gateCFLAGS+=	-DPACKAGE_VERSION=\"${VERSION}\"
160Sstevel@tonic-gateCFLAGS+=	-I${.OBJDIR}
170Sstevel@tonic-gate
180Sstevel@tonic-gate.if ${MACHINE_ARCH} == "arm"
190Sstevel@tonic-gateWARNS?= 3
200Sstevel@tonic-gate.else
210Sstevel@tonic-gateWARNS?=	6
220Sstevel@tonic-gate.endif
230Sstevel@tonic-gate
240Sstevel@tonic-gateINCS=	archive.h archive_entry.h
250Sstevel@tonic-gate
260Sstevel@tonic-gate# Note: archive.h does need to be listed here, since it's built
270Sstevel@tonic-gateSRCS=	archive.h					\
280Sstevel@tonic-gate	archive_check_magic.c				\
290Sstevel@tonic-gate	archive_entry.c					\
300Sstevel@tonic-gate	archive_read.c					\
310Sstevel@tonic-gate	archive_read_data_into_buffer.c			\
320Sstevel@tonic-gate	archive_read_data_into_fd.c			\
330Sstevel@tonic-gate	archive_read_extract.c				\
340Sstevel@tonic-gate	archive_read_open_fd.c				\
350Sstevel@tonic-gate	archive_read_open_file.c			\
360Sstevel@tonic-gate	archive_read_support_compression_all.c		\
370Sstevel@tonic-gate	archive_read_support_compression_bzip2.c	\
380Sstevel@tonic-gate	archive_read_support_compression_compress.c	\
390Sstevel@tonic-gate	archive_read_support_compression_gzip.c		\
400Sstevel@tonic-gate	archive_read_support_compression_none.c		\
410Sstevel@tonic-gate	archive_read_support_format_all.c		\
420Sstevel@tonic-gate	archive_read_support_format_cpio.c		\
430Sstevel@tonic-gate	archive_read_support_format_iso9660.c		\
440Sstevel@tonic-gate	archive_read_support_format_tar.c		\
450Sstevel@tonic-gate	archive_read_support_format_zip.c		\
460Sstevel@tonic-gate	archive_string.c				\
470Sstevel@tonic-gate	archive_string_sprintf.c			\
480Sstevel@tonic-gate	archive_util.c					\
490Sstevel@tonic-gate	archive_write.c					\
500Sstevel@tonic-gate	archive_write_open_fd.c				\
510Sstevel@tonic-gate	archive_write_open_file.c			\
520Sstevel@tonic-gate	archive_write_set_compression_bzip2.c		\
530Sstevel@tonic-gate	archive_write_set_compression_gzip.c		\
540Sstevel@tonic-gate	archive_write_set_compression_none.c		\
550Sstevel@tonic-gate	archive_write_set_format.c			\
560Sstevel@tonic-gate	archive_write_set_format_by_name.c		\
570Sstevel@tonic-gate	archive_write_set_format_cpio.c			\
580Sstevel@tonic-gate	archive_write_set_format_pax.c			\
590Sstevel@tonic-gate	archive_write_set_format_shar.c			\
600Sstevel@tonic-gate	archive_write_set_format_ustar.c
610Sstevel@tonic-gate
620Sstevel@tonic-gateMAN=	archive_entry.3					\
630Sstevel@tonic-gate	archive_read.3					\
640Sstevel@tonic-gate	archive_util.3					\
650Sstevel@tonic-gate	archive_write.3					\
660Sstevel@tonic-gate	libarchive.3					\
670Sstevel@tonic-gate	libarchive-formats.5				\
680Sstevel@tonic-gate	tar.5
690Sstevel@tonic-gate
700Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_add_entry.3
710Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_add_entry_w.3
720Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_clear.3
730Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_count.3
740Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_next.3
750Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_next_w.3
760Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_reset.3
770Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_acl_text_w.3
780Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_clear.3
790Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_clone.3
800Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_fflags_text_w.3
810Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_gname_w.3
820Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_hardlink_w.3
830Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_pathname_w.3
840Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_stat.3
850Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_symlink_w.3
860Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_copy_uname_w.3
870Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_fflags.3
880Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_fflags_text.3
890Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_free.3
900Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_gid.3
910Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_gname.3
920Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_gname_w.3
930Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_hardlink.3
940Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_ino.3
950Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_mode.3
960Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_mtime.3
970Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_mtime_nsec.3
980Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_new.3
990Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_pathname.3
1000Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_pathname_w.3
1010Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_rdev.3
1020Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_rdevmajor.3
1030Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_rdevminor.3
1040Sstevel@tonic-gateMLINKS+=	archive_entry.3 archive_entry_set_fflags.3
1050Sstevel@tonic-gateMLINKS+=	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_iso9660.3
145MLINKS+=	archive_read.3 archive_read_support_format_tar.3
146MLINKS+=	archive_read.3 archive_read_support_format_zip.3
147MLINKS+=	archive_util.3 archive_compression.3
148MLINKS+=	archive_util.3 archive_compression_name.3
149MLINKS+=	archive_util.3 archive_errno.3
150MLINKS+=	archive_util.3 archive_error_string.3
151MLINKS+=	archive_util.3 archive_format.3
152MLINKS+=	archive_util.3 archive_format_name.3
153MLINKS+=	archive_util.3 archive_set_error.3
154MLINKS+=	archive_write.3 archive_write_data.3
155MLINKS+=	archive_write.3 archive_write_finish.3
156MLINKS+=	archive_write.3 archive_write_header.3
157MLINKS+=	archive_write.3 archive_write_new.3
158MLINKS+=	archive_write.3 archive_write_open.3
159MLINKS+=	archive_write.3 archive_write_open_fd.3
160MLINKS+=	archive_write.3 archive_write_open_file.3
161MLINKS+=	archive_write.3 archive_write_prepare.3
162MLINKS+=	archive_write.3 archive_write_set_bytes_per_block.3
163MLINKS+=	archive_write.3 archive_write_set_bytes_in_last_block.3
164MLINKS+=	archive_write.3 archive_write_set_callbacks.3
165MLINKS+=	archive_write.3 archive_write_set_compression_bzip2.3
166MLINKS+=	archive_write.3 archive_write_set_compression_gzip.3
167MLINKS+=	archive_write.3 archive_write_set_format_pax.3
168MLINKS+=	archive_write.3 archive_write_set_format_shar.3
169MLINKS+=	archive_write.3 archive_write_set_format_ustar.3
170MLINKS+=	libarchive.3 archive.3
171
172# Build archive.h from archive.h.in
173archive.h:	archive.h.in Makefile
174	cat ${.CURDIR}/archive.h.in |					\
175		sed 's/@ARCHIVE_API_VERSION@/${ARCHIVE_API_VERSION}/' |	\
176		sed 's/@ARCHIVE_API_FEATURE@/${ARCHIVE_API_FEATURE}/' |	\
177		cat > archive.h
178
179# archive.h needs to be cleaned
180CLEANFILES+=	archive.h
181
182#
183# Voodoo for building a distfile that uses autoconf/automake/etc.
184#
185
186# Files that just get copied to the distfile build directory
187DIST_WORK_DIR=	${.OBJDIR}/lib${LIB}-${VERSION}
188CLEANDIRS+=	${DIST_WORK_DIR}
189DISTFILE=	lib${LIB}-${VERSION}.tar.gz
190DIST_FILES=	${SRCS}
191DIST_FILES+=	${MAN}
192DIST_FILES+=	archive.h.in
193DIST_FILES+=	archive_entry.h archive_platform.h
194DIST_FILES+=	archive_private.h archive_string.h
195DIST_FILES+=	Makefile.am
196
197distfile:
198	rm -rf ${DIST_WORK_DIR}
199	mkdir ${DIST_WORK_DIR}
200	for f in ${DIST_FILES};					\
201	do							\
202		cat ${.CURDIR}/$$f >${DIST_WORK_DIR}/$$f || true;	\
203	done
204	cat ${.CURDIR}/configure.ac.in |			\
205		sed 's/@VERSION@/${VERSION}/' |			\
206		cat > ${DIST_WORK_DIR}/configure.ac
207	(cd ${DIST_WORK_DIR} && aclocal && autoheader)
208	(cd ${DIST_WORK_DIR} && autoconf && automake -a --foreign)
209	(cd ${DIST_WORK_DIR} && ./configure && make distcheck && make dist)
210	mv ${DIST_WORK_DIR}/${DISTFILE} ${.OBJDIR}
211	@echo ==================================================
212	@echo Created ${.OBJDIR}/${DISTFILE}
213	@echo ==================================================
214
215.include <bsd.lib.mk>
216