This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
corelibs/template/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 = template.c
HDR = template.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