56 lines
854 B
Makefile
56 lines
854 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 = dynarray.c
|
|
HDR = dynarray.h
|
|
OBJ = ${SRC:.c=.o}
|
|
|
|
all: ${OBJ}
|
|
|
|
%.o: %.c
|
|
${CC} -c ${CFLAGS} -o $@ $<
|
|
|
|
clean:
|
|
rm -f ${OBJ}
|
|
|
|
install: all
|
|
mkdir -p "${DESTDIR}${PREFIX}/lib/corelibs"
|
|
cp -f ${OBJ} "${DESTDIR}${PREFIX}/lib/corelibs"
|
|
mkdir -p "${DESTDIR}${PREFIX}/include/corelibs"
|
|
cp -f ${HDR} "${DESTDIR}${PREFIX}/include/corelibs"
|
|
|
|
.PHONY: all clean install
|