diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-09-01 05:06:42 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-09-01 05:06:42 +0000 |
commit | 43e23069c32c016174f6e0f07b9de2fcd229cf5c (patch) | |
tree | acf2f3e73310c3bb4fd45a19643c9c38be1abaf4 /lib/libarchive | |
parent | e9d9514975605045da565470477ceafa13f6174b (diff) | |
download | FreeBSD-src-43e23069c32c016174f6e0f07b9de2fcd229cf5c.zip FreeBSD-src-43e23069c32c016174f6e0f07b9de2fcd229cf5c.tar.gz |
Per Ruslan, bsd.lib.mk already has support for dynamically-generated
.h files. This simplifies the Makefile here a bit and makes it behave
better in a couple of situations. While I'm here, clean up some comments
and try to improve the organization a bit.
Thanks to: Ruslan Ermilov (The Marvelous Makefile Guru)
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/Makefile | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile index b4be646..55d2aaf 100644 --- a/lib/libarchive/Makefile +++ b/lib/libarchive/Makefile @@ -27,7 +27,9 @@ NOPIC= 1 INCS= archive.h archive_entry.h -SRCS= archive_check_magic.c \ +# Note: archive.h does need to be listed here, since it's built +SRCS= archive.h \ + archive_check_magic.c \ archive_entry.c \ archive_read.c \ archive_read_data_into_buffer.c \ @@ -166,20 +168,6 @@ MLINKS+= archive_write.3 archive_write_set_format_shar.3 MLINKS+= archive_write.3 archive_write_set_format_ustar.3 MLINKS+= libarchive.3 archive.3 -# -# archive.h is built dynamically, which has a number of implications... -# - -# Ensure archive.h gets built before we compute dependencies. -beforedepend: archive.h -afterdepend: - echo "archive.h: Makefile" >> ${DEPENDFILE} -# Ensure archive.h gets built before we compile anything. -${SRCS:S/.c$/.o/}: archive.h - -# archive.h needs to be cleaned -CLEANFILES+= archive.h - # Build archive.h from archive.h.in archive.h: archive.h.in Makefile cat ${.CURDIR}/archive.h.in | \ @@ -187,8 +175,16 @@ archive.h: archive.h.in Makefile sed 's/@ARCHIVE_API_FEATURE@/${ARCHIVE_API_FEATURE}/' | \ cat > archive.h +# archive.h needs to be cleaned +CLEANFILES+= archive.h + +# +# Voodoo for building a distfile that uses autoconf/automake/etc. +# + # Files that just get copied to the distfile build directory DIST_WORK_DIR= ${.OBJDIR}/lib${LIB}-${VERSION} +CLEANDIRS+= ${DIST_WORK_DIR} DISTFILE= lib${LIB}-${VERSION}.tar.gz DIST_FILES= ${SRCS} DIST_FILES+= ${MAN} @@ -197,8 +193,6 @@ DIST_FILES+= archive_entry.h archive_platform.h DIST_FILES+= archive_private.h archive_string.h DIST_FILES+= Makefile.am -CLEANDIRS+= ${DIST_WORK_DIR} - distfile: rm -rf ${DIST_WORK_DIR} mkdir ${DIST_WORK_DIR} |