77 lines
1.0 KiB
Makefile
77 lines
1.0 KiB
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
|
|
|
|
else ifeq (${CC},tcc)
|
|
|
|
CFLAGS =\
|
|
-Wall
|
|
|
|
ifeq (${DEBUG},1)
|
|
CFLAGS += -g
|
|
else
|
|
CFLAGS += -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
|