61 lines
906 B
Makefile
61 lines
906 B
Makefile
|
include config.mk
|
||
|
|
||
|
ifeq (${CC},clang)
|
||
|
|
||
|
CFLAGS :=\
|
||
|
-std=c99\
|
||
|
-Weverything\
|
||
|
-Wno-padded\
|
||
|
-Wno-disabled-macro-expansion\
|
||
|
-pedantic\
|
||
|
${CFLAGS}
|
||
|
|
||
|
else ifeq (${CC},gcc)
|
||
|
|
||
|
CFLAGS :=\
|
||
|
-std=c99\
|
||
|
-Wall\
|
||
|
-Wextra\
|
||
|
-Wformat-overflow=2\
|
||
|
-Wformat-security\
|
||
|
-Winit-self\
|
||
|
-Wstrict-overflow=2\
|
||
|
-Wstringop-overflow=2\
|
||
|
-Walloc-zero\
|
||
|
-Wduplicated-branches\
|
||
|
-Wduplicated-cond\
|
||
|
-Wtrampolines\
|
||
|
-Wfloat-equal\
|
||
|
-Wshadow\
|
||
|
-Wunsafe-loop-optimizations\
|
||
|
-Wparentheses\
|
||
|
-pedantic\
|
||
|
${CFLAGS}
|
||
|
|
||
|
endif
|
||
|
|
||
|
SRC = llist.c
|
||
|
HDR = llist.h
|
||
|
LIB = llist.a
|
||
|
OBJ = ${SRC:.c=.o}
|
||
|
|
||
|
all: ${LIB}
|
||
|
|
||
|
.c.o:
|
||
|
${CC} -c ${CFLAGS} $<
|
||
|
|
||
|
${LIB}: ${OBJ}
|
||
|
${AR} rc $@ $?
|
||
|
${RANLIB} $@
|
||
|
|
||
|
clean:
|
||
|
rm -f ${LIB} ${OBJ}
|
||
|
|
||
|
install: all
|
||
|
mkdir -p "${DESTDIR}${PREFIX}/lib/corelibs"
|
||
|
cp -f ${LIB} "${DESTDIR}${PREFIX}/lib/corelibs"
|
||
|
mkdir -p "${DESTDIR}${PREFIX}/include/corelibs"
|
||
|
cp -f ${HDR} "${DESTDIR}${PREFIX}/include/corelibs"
|
||
|
|
||
|
.PHONY: all clean install
|