Makefile (1155B)
1 # libds - a simple data structures library 2 # See LICENSE file for copyright and license details. 3 4 include config.mk 5 6 SRC = fifo.c stack.c str.c tokenize.c vector.c 7 OBJ = ${SRC:.c=.o} 8 SOUT = ${NAME}.a 9 10 all: options ${SOUT} 11 12 options: 13 @echo ${NAME} build options: 14 @echo "CFLAGS = ${CFLAGS}" 15 @echo "LDFLAGS = ${LDFLAGS}" 16 @echo "CC = ${CC}" 17 18 .c.o: 19 @echo CC $< 20 @${CC} -c ${CFLAGS} $< 21 22 ${OBJ}: config.mk 23 24 ${SOUT}: ${OBJ} 25 @ar rcs ${SOUT} ${OBJ} 26 27 clean: 28 @echo cleaning 29 @rm -f *.a ${NAME} ${OBJ} 30 31 install: all 32 @echo installing libraries to ${DESTDIR}${PREFIX}/lib 33 @mkdir -p ${DESTDIR}${PREFIX}/lib 34 @cp -f ${NAME}.a ${DESTDIR}${PREFIX}/lib 35 @chmod 755 ${DESTDIR}${PREFIX}/lib/${NAME}.* 36 @echo installing header file to ${DESTDIR}${PREFIX}/include 37 @mkdir -p ${DESTDIR}${PREFIX}/include 38 @cp -f ds.h ${DESTDIR}${PREFIX}/include 39 @chmod 644 ${DESTDIR}${PREFIX}/include/ds.h 40 41 uninstall: 42 @echo removing libraries from ${DESTDIR}${PREFIX}/lib 43 @rm -f ${DESTDIR}${PREFIX}/lib/${NAME}.a 44 @echo removing header file from ${DESTDIR}${PREFIX}/include 45 @rm -f ${DESTDIR}${PREFIX}/include/ds.h 46 47 .PHONY: all options clean install uninstall 48 # DO NOT DELETE