This repository has been archived on 2021-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
dynarray/Makefile

66 lines
969 B
Makefile

include config.mk
include sources.mk
ifeq (${CC},clang)
CFLAGS =\
-std=c99\
-Weverything\
-Wno-padded\
-Wno-disabled-macro-expansion\
-pedantic
ifeq (${DEBUG},1)
CFLAGS += -g
else
CFLAGS += -O2 -Werror
endif
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
ifeq (${DEBUG},1)
CFLAGS += -g
else
CFLAGS += -O2 -Werror
endif
endif
CFLAGS += ${EXTRA_CFLAGS}
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