2021-08-10 18:06:44 +00:00
|
|
|
include config.mk
|
2021-08-17 18:43:57 +00:00
|
|
|
include sources.mk
|
2021-08-10 18:06:44 +00:00
|
|
|
|
|
|
|
ifeq (${CC},clang)
|
2021-08-22 20:27:19 +00:00
|
|
|
|
2021-08-17 18:43:57 +00:00
|
|
|
CFLAGS =\
|
2021-08-10 18:06:44 +00:00
|
|
|
-std=c99\
|
|
|
|
-Weverything\
|
|
|
|
-Wno-padded\
|
|
|
|
-Wno-disabled-macro-expansion\
|
2021-08-17 18:43:57 +00:00
|
|
|
-pedantic
|
2021-08-22 20:27:19 +00:00
|
|
|
|
|
|
|
ifeq (${DEBUG},1)
|
|
|
|
CFLAGS += -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O2 -Werror
|
|
|
|
endif
|
|
|
|
|
2021-08-10 18:06:44 +00:00
|
|
|
else ifeq (${CC},gcc)
|
2021-08-22 20:27:19 +00:00
|
|
|
|
2021-08-17 18:43:57 +00:00
|
|
|
CFLAGS =\
|
2021-08-10 18:06:44 +00:00
|
|
|
-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\
|
2021-08-17 18:43:57 +00:00
|
|
|
-pedantic
|
2021-08-10 18:06:44 +00:00
|
|
|
|
2021-08-17 18:43:57 +00:00
|
|
|
ifeq (${DEBUG},1)
|
|
|
|
CFLAGS += -g
|
|
|
|
else
|
2021-08-22 20:27:19 +00:00
|
|
|
CFLAGS += -O2 -Werror
|
|
|
|
endif
|
|
|
|
|
2021-08-10 18:06:44 +00:00
|
|
|
endif
|
2021-08-22 20:27:19 +00:00
|
|
|
CFLAGS += ${EXTRA_CFLAGS}
|
2021-08-10 18:06:44 +00:00
|
|
|
|
|
|
|
OBJ = ${SRC:.c=.o}
|
|
|
|
|
2021-08-13 14:59:18 +00:00
|
|
|
all: ${OBJ}
|
2021-08-10 18:06:44 +00:00
|
|
|
|
2021-08-13 16:32:59 +00:00
|
|
|
%.o: %.c
|
|
|
|
${CC} -c ${CFLAGS} -o $@ $<
|
2021-08-10 18:06:44 +00:00
|
|
|
|
|
|
|
clean:
|
2021-08-13 14:59:18 +00:00
|
|
|
rm -f ${OBJ}
|
2021-08-10 18:06:44 +00:00
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p "${DESTDIR}${PREFIX}/lib/corelibs"
|
2021-08-13 14:59:18 +00:00
|
|
|
cp -f ${OBJ} "${DESTDIR}${PREFIX}/lib/corelibs"
|
2021-08-10 18:06:44 +00:00
|
|
|
mkdir -p "${DESTDIR}${PREFIX}/include/corelibs"
|
|
|
|
cp -f ${HDR} "${DESTDIR}${PREFIX}/include/corelibs"
|
|
|
|
|
|
|
|
.PHONY: all clean install
|