diff options
author | 2023-03-01 16:11:17 +0100 | |
---|---|---|
committer | 2023-03-01 16:11:17 +0100 | |
commit | 8d81ffef00f5cf2c267fb855715b76cdf004bc52 (patch) | |
tree | d1ffe2485627e8f64d6b1a908fad2ae872d1eee6 /Makefile | |
parent | 2392a52c10fdb32e504cb76d5f1989df7a643655 (diff) | |
download | string2-8d81ffef00f5cf2c267fb855715b76cdf004bc52.tar.gz string2-8d81ffef00f5cf2c267fb855715b76cdf004bc52.zip |
Keep it simple
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 61 |
1 files changed, 6 insertions, 55 deletions
@@ -1,59 +1,10 @@ # See LICENSE file for copyright and license details. -include config.mk +PREFIX=/usr/local +INStALL_DIR=${PREFIX}/include -CC = cc +instal: + cp string2.h ${INSTALL_DIR}/string2.h -# Used for debugging and not as usual -OBJ = ${SRC:.c=.o} - -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 All done. - -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 - -${INSTALL_LIB_DIR}: - mkdir -p $@ - -${INSTALL_INC_DIR}: - mkdir -p $@ - -install: all ${INSTALL_LIB_DIR} ${INSTALL_INC_DIR} - cp ${LIBNAME:=.a} ${INSTALL_LIB_DIR}/${LIBNAME:=.a} - cp ${LIBNAME:=.so} ${INSTALL_LIB_DIR}/${LIBNAME:=.so} - cp src/string2.h ${INSTALL_INC_DIR}/string2.h - -# Generated by makemk script -include target.mk +uninstall: + rm -f ${INSTALL_DIR}/string2.h |