head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.26 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.24 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.22 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.20 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.18 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.16 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.14 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.12 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.10 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.8 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.6 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.4 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.2 pkgsrc-2023Q1-base:1.1; locks; strict; comment @# @; 1.1 date 2023.01.27.10.30.49; author micha; state Exp; branches; next ; commitid zIuUh1YBXFuypabE; desc @@ 1.1 log @devel/sds: Import version 2.2 SDS is a string library for C designed to augment the limited libc string handling functionalities by adding heap allocated strings that are: * Simpler to use. * Binary safe. * Computationally more efficient. * But yet... Compatible with normal C string functions. @ text @$NetBSD$ * Add targets for object file, library, test and install. * Honor CPPFLAGS, CFLAGS and LDFLAGS * Use libtool --- Makefile.orig 2021-07-14 10:28:45.000000000 +0000 +++ Makefile @@@@ -1,8 +1,44 @@@@ -all: sds-test +# Switch make into POSIX conformant mode (must be the first non-comment line) +.POSIX: -sds-test: sds.c sds.h testhelp.h - $(CC) -o sds-test sds.c -Wall -std=c99 -pedantic -O2 -DSDS_TEST_MAIN - @@echo ">>> Type ./sds-test to run the sds.c unit tests." +# Clear suffix list for inference rules +.SUFFIXES: + +# ABI version for shared library +MAJOR= 2 +MINOR= 2 +PATCH= 0 + +all: libsds.la + +test: sds-test + ./sds-test + +install: libsds.la + @@set +u ; test "x$$PREFIX" != "x" || \ + ! echo "Error: PREFIX not defined in environment" + install -d -m 755 "${DESTDIR}${PREFIX}/lib" + libtool --mode=install \ + install -m 755 libsds.la "${DESTDIR}${PREFIX}/lib" + install -d -m 755 "${DESTDIR}${PREFIX}/include" + install -m 644 sds.h "${DESTDIR}${PREFIX}/include" + install -d -m 755 "${DESTDIR}${PREFIX}/share/doc/sds" + install -m 644 README.md "${DESTDIR}${PREFIX}/share/doc/sds" clean: - rm -f sds-test + rm -f sds-test sds.o sds.lo libsds.la + rm -rf ./.libs + +sds.lo: sds.c sds.h + libtool --tag=CC --mode=compile \ + $(CC) $(CPPFLAGS) $(CFLAGS) -c -Wall -std=c99 -pedantic -O2 sds.c + +libsds.la: sds.lo + libtool --tag=CC --mode=link \ + $(CC) $(LDFLAGS) -shared -o libsds.la sds.lo \ + -version-number ${MAJOR}:${MINOR}:${PATCH} \ + -rpath ${PREFIX}/lib + +sds-test: sds.c sds.h testhelp.h + $(CC) $(CPPFLAGS) $(CFLAGS) -Wall -std=c99 -pedantic -O2 \ + -DSDS_TEST_MAIN -o sds-test sds.c @