# See LICENSE file for copyright and license details. include config.mk CC = cc # Used for debugging and not as usual OBJ = ${SRC:.c=.o} LIBNAME = libstr LIBVER = 0.0.0-a2 OPTIM = -O2 -pipe STD = -ansi --std=c89 -pedantic WARNS = -Werror -Wall LDFLAGS = CFLAGS = ${WARNS} ${STD} -DLIBVER=\"${LIBVER}\" ${OPTIM} # CFLAGS for debugging CDFLAGS = ${WARNS} ${STD} -DLIBVER=\"${LIBVER}\" -g all: ${LIBNAME:=.a} ${LIBNAME:=.so} @echo ${STD}. debug: ${OBJ} .c.o: ${CC} ${CDFLAGS} -c $< -o $@ # Make shared and archive directories ${ARDIR} ${SHDIR}: mkdir -p $@ # Make archive file ${LIBNAME:=.a}: ${ARDIR} ${AROBJ} ar rcs $@ ${AROBJ} # Make shared file ${LIBNAME:=.so}: ${SHDIR} ${SHOBJ} ${CC} ${LDFLAGS} -shared ${SHOBJ} -o $@ clean: rm -rf bin ${LIBNAME}.* *.core ${OBJ} cd test && make clean tests: all cd test && make clean tests # Generated by makemk script include target.mk