cstring

Lightweight string library for C
git clone git://git.christosmarg.xyz/cstring.git
Log | Files | Refs | README | LICENSE

commit 999f91450796c7a6ed97f8d6bc9751c9a88d4742
parent 9cac873acc706b2a683ed1541c367e38768cb999
Author: Christos Margiolis <christos@margiolis.net>
Date:   Tue, 20 Oct 2020 18:49:02 +0300

removed wildcards

Diffstat:
MMakefile | 52+++++++++++++++++++++++++++-------------------------
Mtests/Makefile | 40++++++++++++++++++++--------------------
2 files changed, 47 insertions(+), 45 deletions(-)

diff --git a/Makefile b/Makefile @@ -10,8 +10,10 @@ INC_DIR = ${PREFIX}/include LIB_DIR = ${PREFIX}/lib EXT = c -SRC = ${wildcard *.${EXT}} -OBJ = ${SRC:%.${EXT}=%.o} +#SRC = ${wildcard *.${EXT}} +#OBJ = ${SRC:%.${EXT}=%.o} +SRC = cstring.c +OBJ = cstring.o AR = ar ARFLAGS = rs @@ -33,40 +35,40 @@ GZIP = gzip all: options ${LIB} options: - @echo ${LIB} build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" + @echo ${LIB} build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" ${LIB}: ${OBJ} - ${AR} ${ARFLAGS} lib${LIB}.a ${OBJ} + ${AR} ${ARFLAGS} lib${LIB}.a ${OBJ} ${OBJ}: ${SRC} - ${CC} ${CFLAGS} -c $< -o $@ + ${CC} ${CFLAGS} -c ${SRC} -o $@ dist: clean - ${MKDIR} ${DIST} - ${CP} -R tests ${SRC} ${MAN3} LICENSE Makefile README.md ${DIST} - ${TAR} ${DIST}.tar ${DIST} - ${GZIP} ${DIST}.tar - ${RM_DIR} ${DIST} + ${MKDIR} ${DIST} + ${CP} -R tests ${SRC} ${MAN3} LICENSE Makefile README.md ${DIST} + ${TAR} ${DIST}.tar ${DIST} + ${GZIP} ${DIST}.tar + ${RM_DIR} ${DIST} install: all - ${MKDIR} ${DESTDIR}${LIB_DIR} ${DESTDIR}${INC_DIR} ${DESTDIR}${MAN_DIR} - ${CP} ${LIB}.h ${DESTDIR}${INC_DIR} - ${CP} lib${LIB}.a ${DESTDIR}${LIB_DIR} - ${CP} ${MAN3} ${DESTDIR}${MAN_DIR} - sed "s/VERSION/${VERSION}/g" < ${MAN3} > ${DESTDIR}${MAN_DIR}/${MAN3} - chmod 755 ${DESTDIR}${INC_DIR}/${LIB}.h - chmod 644 ${DESTDIR}${LIB_DIR}/lib${LIB}.a - chmod 644 ${DESTDIR}${MAN_DIR}/${MAN3} + ${MKDIR} ${DESTDIR}${LIB_DIR} ${DESTDIR}${INC_DIR} ${DESTDIR}${MAN_DIR} + ${CP} ${LIB}.h ${DESTDIR}${INC_DIR} + ${CP} lib${LIB}.a ${DESTDIR}${LIB_DIR} + ${CP} ${MAN3} ${DESTDIR}${MAN_DIR} + sed "s/VERSION/${VERSION}/g" < ${MAN3} > ${DESTDIR}${MAN_DIR}/${MAN3} + chmod 755 ${DESTDIR}${INC_DIR}/${LIB}.h + chmod 644 ${DESTDIR}${LIB_DIR}/lib${LIB}.a + chmod 644 ${DESTDIR}${MAN_DIR}/${MAN3} uninstall: - ${RM} ${DESTDIR}${INC_DIR}/${LIB}.h - ${RM} ${DESTDIR}${LIB_DIR}/lib${LIB}.a - ${RM} ${DESTDIR}${MAN_DIR}/${MAN3} + ${RM} ${DESTDIR}${INC_DIR}/${LIB}.h + ${RM} ${DESTDIR}${LIB_DIR}/lib${LIB}.a + ${RM} ${DESTDIR}${MAN_DIR}/${MAN3} clean: - ${RM} ${LIB} ${OBJ} lib${LIB}.a ${DIST}.tar.gz + ${RM} ${LIB} ${OBJ} lib${LIB}.a ${DIST}.tar.gz .PHONY: all options clean dist install uninstall diff --git a/tests/Makefile b/tests/Makefile @@ -6,33 +6,33 @@ LDFLAGS = -Llib -lcstring all: options ${BINS} options: - @echo "build options:" - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" + @echo "build options:" + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" run: - @echo "---------------------------" - @echo "---------------------------" - @echo "RUNNING: test_basic" - @echo "---------------------------" - @echo "---------------------------" - ./test_basic - - @echo "---------------------------" - @echo "---------------------------" - @echo "RUNNING: test_insert" - @echo "---------------------------" - @echo "---------------------------" - ./test_insert + @echo "---------------------------" + @echo "---------------------------" + @echo "RUNNING: test_basic" + @echo "---------------------------" + @echo "---------------------------" + ./test_basic + + @echo "---------------------------" + @echo "---------------------------" + @echo "RUNNING: test_insert" + @echo "---------------------------" + @echo "---------------------------" + ./test_insert clean: - rm -f ${BINS} *.o + rm -f ${BINS} *.o test_basic: test_basic.c - ${CC} test_basic.c ${CFLAGS} -o test_basic ${LDFLAGS} + ${CC} test_basic.c ${CFLAGS} -o test_basic ${LDFLAGS} test_insert: test_insert.c - ${CC} test_insert.c ${CFLAGS} -o test_insert ${LDFLAGS} + ${CC} test_insert.c ${CFLAGS} -o test_insert ${LDFLAGS} .PHONY: all options run clean