head	1.5;
access;
symbols
	netbsd-11-0-RC5:1.5
	netbsd-11-0-RC4:1.5
	netbsd-11-0-RC3:1.5
	netbsd-11-0-RC2:1.5
	netbsd-11-0-RC1:1.5
	perseant-exfatfs-base-20250801:1.5
	netbsd-11:1.5.0.4
	netbsd-11-base:1.5
	netbsd-10-1-RELEASE:1.3
	perseant-exfatfs-base-20240630:1.5
	perseant-exfatfs:1.5.0.2
	perseant-exfatfs-base:1.5
	netbsd-10-0-RELEASE:1.3
	netbsd-10-0-RC6:1.3
	netbsd-10-0-RC5:1.3
	netbsd-10-0-RC4:1.3
	netbsd-10-0-RC3:1.3
	netbsd-10-0-RC2:1.3
	netbsd-10-0-RC1:1.3
	netbsd-10:1.3.0.8
	netbsd-10-base:1.3
	cjep_sun2x-base1:1.3
	cjep_sun2x:1.3.0.6
	cjep_sun2x-base:1.3
	cjep_staticlib_x-base1:1.3
	cjep_staticlib_x:1.3.0.4
	cjep_staticlib_x-base:1.3
	phil-wifi-20200421:1.3
	phil-wifi:1.3.0.2
	phil-wifi-20200411:1.3
	phil-wifi-20200406:1.3;
locks; strict;
comment	@# @;


1.5
date	2024.06.24.18.01.03;	author riastradh;	state Exp;
branches;
next	1.4;
commitid	kAJwCbWzUGH8ogfF;

1.4
date	2024.06.22.13.36.54;	author riastradh;	state Exp;
branches;
next	1.3;
commitid	61kW9ChgBMbsZYeF;

1.3
date	2020.03.04.17.22.49;	author christos;	state Exp;
branches
	1.3.2.1;
next	1.2;
commitid	EEEsVaEzrAKPJ6ZB;

1.2
date	2020.03.03.23.32.58;	author mlelstv;	state Exp;
branches;
next	1.1;
commitid	kmNkpRIqAgjOO0ZB;

1.1
date	2020.03.03.00.36.18;	author christos;	state Exp;
branches;
next	;
commitid	dQa39y533ymxcTYB;

1.3.2.1
date	2020.03.04.17.22.49;	author martin;	state dead;
branches;
next	1.3.2.2;
commitid	X01YhRUPVUDaec4C;

1.3.2.2
date	2020.04.13.08.02.29;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;


desc
@@


1.5
log
@libcbor: Undo make dependencies `fix' and tidy up.

1. There is no need for ${ALLOBJS} to depend on cbor/configuration.h,
   because cbor/configuration.h is already installed by make includes
   long before we get to make dependall, let alone make all.

2. Now that we don't use ${ALLOBJS} in a rule, put bsd.lib.mk at the
   end where it normally belongs.

3. Make the cbor/configuration.h recipe interruption-safe by writing
   to a temporary file first and then renaming it.

4. Nix needless empty .BEGIN rule.  Pretty sure this doesn't do
   anything.

My previous hypothesis about why this could have happened ceased to
make sense once I realized that cbor/configuration.h is supposed to
be installed in /usr/include.  I no longer have a hypothesis about
how PR lib/58359 could have happened, unless perhaps the build had
been previously interrupted, leaving an empty
$DESTDIR/usr/include/cbor/configuration.h file.
@
text
@# $NetBSD: Makefile,v 1.4 2024/06/22 13:36:54 riastradh Exp $

NOLINT=
NOMAN=
.include <bsd.own.mk>

DIST = ${.CURDIR}/../dist

.PATH: ${DIST}/src ${DIST}/src/cbor ${DIST}/src/cbor/internal

CPPFLAGS+= -I${DIST}/src -DHAVE_ENDIAN_H -I. -DEIGHT_BYTE_SIZE_T

.if ${MACHINE} == "vax"
# vax does not have NaN (no ieee754, so this code will not work anyway)
CPPFLAGS+=-DNAN=INFINITY
.endif

LIB=    cbor

SRCS+=   cbor.c

# For ldexp
LIBDPLIBS = m ${NETBSDSRCDIR}/lib/libm

VERS_FILE=${DIST}/CMakeLists.txt

.for i in MAJOR MINOR PATCH
CBOR_VERSION_${i} != \
    ${TOOL_SED} -ne '/CBOR_VERSION_${i}/s/.*"\([0-9]*\)")$$/\1/p' ${VERS_FILE}
.endfor

CBOR_VERSION = ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH}

# cbor/
SRCS+= \
arrays.c \
bytestrings.c \
callbacks.c \
common.c \
encoding.c \
floats_ctrls.c \
ints.c \
maps.c \
serialization.c \
streaming.c \
strings.c \
tags.c

# cbor/internal
SRCS+= \
builder_callbacks.c \
encoders.c \
loaders.c \
memory_utils.c \
stack.c \
unicode.c

INCS+= \
cbor.h \
cbor/arrays.h \
cbor/bytestrings.h \
cbor/callbacks.h \
cbor/common.h \
cbor/configuration.h \
cbor/data.h \
cbor/encoding.h \
cbor/floats_ctrls.h \
cbor/ints.h \
cbor/maps.h \
cbor/serialization.h \
cbor/streaming.h \
cbor/strings.h \
cbor/tags.h

INCSDIR=/usr/include

PKGCONFIG=libcbor

.SUFFIXES: .in

.in:
	${TOOL_SED} \
	    -e s@@CMAKE_INSTALL_PREFIX@@/usr@@ \
	    -e s@@CMAKE_INSTALL_LIBDIR@@/lib@@ \
	    -e s@@PROJECT_NAME@@libcbor@@ \
	    -e s@@CBOR_VERSION@@${CBOR_VERSION}@@ ${.ALLSRC} > ${.TARGET}

libcbor.pc: libcbor.pc.in

SHLIB_MAJOR=    0
SHLIB_MINOR=    5

cbor/configuration.h: ${VERS_FILE}
	${_MKTARGET_CREATE}
	mkdir -p cbor && ( \
	echo	'#define CBOR_MAJOR_VERSION ${CBOR_VERSION_MAJOR}' && \
	echo	'#define CBOR_MINOR_VERSION ${CBOR_VERSION_MINOR}' && \
	echo	'#define CBOR_PATCH_VERSION ${CBOR_VERSION_PATCH}' && \
	echo	'#define CBOR_CUSTOM_ALLOC 0' && \
	echo	'#define CBOR_BUFFER_GROWTH 2' && \
	echo	'#define CBOR_PRETTY_PRINTER 1' && \
	echo	'#define CBOR_RESTRICT_SPECIFIER restrict' && \
	echo	'#define CBOR_INLINE_SPECIFIER ') > ${.TARGET}.tmp && \
	${MV} ${.TARGET}.tmp ${.TARGET}

CLEANFILES+= cbor/configuration.h
CLEANFILES+= cbor/configuration.h.tmp

.include <bsd.lib.mk>
@


1.4
log
@libcbor: Fix make dependencies on configuration.h.

PR lib/58359
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2020/03/04 17:22:49 christos Exp $
a92 4
.include <bsd.lib.mk>

${ALLOBJS}: cbor/configuration.h

d94 2
a95 1
	@@mkdir -p cbor && ( \
d103 2
a104 1
	echo	'#define CBOR_INLINE_SPECIFIER ') > ${.TARGET}
d107 1
d109 1
a109 2
.BEGIN:

@


1.3
log
@Fix vax and platforms that don't have ldexp in libc (aarch64, ppc64, ia64)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2020/03/03 23:32:58 mlelstv Exp $
d95 1
a95 1
${OBJS}: cbor/configuration.h
@


1.3.2.1
log
@file Makefile was added on branch phil-wifi on 2020-04-13 08:02:29 +0000
@
text
@d1 111
@


1.3.2.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@a0 111
# $NetBSD: Makefile,v 1.3 2020/03/04 17:22:49 christos Exp $

NOLINT=
NOMAN=
.include <bsd.own.mk>

DIST = ${.CURDIR}/../dist

.PATH: ${DIST}/src ${DIST}/src/cbor ${DIST}/src/cbor/internal

CPPFLAGS+= -I${DIST}/src -DHAVE_ENDIAN_H -I. -DEIGHT_BYTE_SIZE_T

.if ${MACHINE} == "vax"
# vax does not have NaN (no ieee754, so this code will not work anyway)
CPPFLAGS+=-DNAN=INFINITY
.endif

LIB=    cbor

SRCS+=   cbor.c

# For ldexp
LIBDPLIBS = m ${NETBSDSRCDIR}/lib/libm

VERS_FILE=${DIST}/CMakeLists.txt

.for i in MAJOR MINOR PATCH
CBOR_VERSION_${i} != \
    ${TOOL_SED} -ne '/CBOR_VERSION_${i}/s/.*"\([0-9]*\)")$$/\1/p' ${VERS_FILE}
.endfor

CBOR_VERSION = ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH}

# cbor/
SRCS+= \
arrays.c \
bytestrings.c \
callbacks.c \
common.c \
encoding.c \
floats_ctrls.c \
ints.c \
maps.c \
serialization.c \
streaming.c \
strings.c \
tags.c

# cbor/internal
SRCS+= \
builder_callbacks.c \
encoders.c \
loaders.c \
memory_utils.c \
stack.c \
unicode.c

INCS+= \
cbor.h \
cbor/arrays.h \
cbor/bytestrings.h \
cbor/callbacks.h \
cbor/common.h \
cbor/configuration.h \
cbor/data.h \
cbor/encoding.h \
cbor/floats_ctrls.h \
cbor/ints.h \
cbor/maps.h \
cbor/serialization.h \
cbor/streaming.h \
cbor/strings.h \
cbor/tags.h

INCSDIR=/usr/include

PKGCONFIG=libcbor

.SUFFIXES: .in

.in:
	${TOOL_SED} \
	    -e s@@CMAKE_INSTALL_PREFIX@@/usr@@ \
	    -e s@@CMAKE_INSTALL_LIBDIR@@/lib@@ \
	    -e s@@PROJECT_NAME@@libcbor@@ \
	    -e s@@CBOR_VERSION@@${CBOR_VERSION}@@ ${.ALLSRC} > ${.TARGET}

libcbor.pc: libcbor.pc.in

SHLIB_MAJOR=    0
SHLIB_MINOR=    5

.include <bsd.lib.mk>

${OBJS}: cbor/configuration.h

cbor/configuration.h: ${VERS_FILE}
	@@mkdir -p cbor && ( \
	echo	'#define CBOR_MAJOR_VERSION ${CBOR_VERSION_MAJOR}' && \
	echo	'#define CBOR_MINOR_VERSION ${CBOR_VERSION_MINOR}' && \
	echo	'#define CBOR_PATCH_VERSION ${CBOR_VERSION_PATCH}' && \
	echo	'#define CBOR_CUSTOM_ALLOC 0' && \
	echo	'#define CBOR_BUFFER_GROWTH 2' && \
	echo	'#define CBOR_PRETTY_PRINTER 1' && \
	echo	'#define CBOR_RESTRICT_SPECIFIER restrict' && \
	echo	'#define CBOR_INLINE_SPECIFIER ') > ${.TARGET}

CLEANFILES+= cbor/configuration.h

.BEGIN:

@


1.2
log
@CLEANFILES can only do files
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2020/03/03 00:36:18 christos Exp $
d13 5
d22 3
@


1.1
log
@Add build glue
@
text
@d1 1
a1 1
# $NetBSD$
d100 1
a100 1
CLEANFILES+= cbor/configuration.h cbor
@

